diff options
author | crupest <crupest@outlook.com> | 2019-02-22 23:09:07 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-02-22 23:09:07 +0800 |
commit | 1db7c93ed333b5016fcc7e5947228db9e9e34b51 (patch) | |
tree | a09c99b3a73642c9a44b385b64090b19ac452ca4 /Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts | |
parent | 4e16aeba21313b527eef904501b7a69a72372791 (diff) | |
download | timeline-1db7c93ed333b5016fcc7e5947228db9e9e34b51.tar.gz timeline-1db7c93ed333b5016fcc7e5947228db9e9e34b51.tar.bz2 timeline-1db7c93ed333b5016fcc7e5947228db9e9e34b51.zip |
Develop link feature on todo page.
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); |