diff options
author | 杨宇千 <crupest@outlook.com> | 2019-02-22 15:24:26 +0000 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-02-22 15:24:26 +0000 |
commit | fe5838a966a314b72ecb4d992f86f5fce635a96f (patch) | |
tree | 6d00a55b9e5f98315384f33aaf5bfc5a60645a0d /Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts | |
parent | 25e606b67506b3bc0242414aebe472f13a02bd9c (diff) | |
parent | e236b5064cd62f40bc910fafe48ac4b9701a4bcd (diff) | |
download | timeline-fe5838a966a314b72ecb4d992f86f5fce635a96f.tar.gz timeline-fe5838a966a314b72ecb4d992f86f5fce635a96f.tar.bz2 timeline-fe5838a966a314b72ecb4d992f86f5fce635a96f.zip |
Merged PR 5: Develop link feature on todo page.
Develop link feature on todo page.
Related work items: #1, #3
Diffstat (limited to 'Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts b/Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts index 7e88ca52..3ed4e004 100644 --- a/Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts +++ b/Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts @@ -19,14 +19,26 @@ describe('TodoListServiceService', () => { const service: TodoListService = TestBed.get(TodoListService); expect(service).toBeTruthy(); + const mockAccessInfo: AzureDevOpsAccessInfo = { + username: 'testusername', + personalAccessToken: 'testtoken', + organization: 'testorganization', + project: 'testproject' + }; + + const generateDetailUrl = (id: number) => + `https://dev.azure.com/${mockAccessInfo.organization}/${mockAccessInfo.project}/_workitems/edit/${id}/`; + const mockWorkItems: WorkItem[] = [{ id: 0, title: 'Test work item 1', - closed: true + closed: true, + detailUrl: generateDetailUrl(0) }, { id: 1, title: 'Test work item 2', - closed: false + closed: false, + detailUrl: generateDetailUrl(1) }]; service.getWorkItemList().subscribe(data => { @@ -35,12 +47,7 @@ describe('TodoListServiceService', () => { const httpController: HttpTestingController = TestBed.get(HttpTestingController); - const mockAccessInfo: AzureDevOpsAccessInfo = { - username: 'testusername', - personalAccessToken: 'testtoken', - organization: 'testorganization', - project: 'testproject' - }; + httpController.expectOne('/api/TodoPage/AzureDevOpsAccessInfo').flush(mockAccessInfo); |