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 | 5189c65192874c0ee7a69449941056294ecd8517 (patch) | |
tree | a09c99b3a73642c9a44b385b64090b19ac452ca4 /Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts | |
parent | 4178d790e3afa5c556751d37453d1d62b16e80be (diff) | |
parent | 1db7c93ed333b5016fcc7e5947228db9e9e34b51 (diff) | |
download | timeline-5189c65192874c0ee7a69449941056294ecd8517.tar.gz timeline-5189c65192874c0ee7a69449941056294ecd8517.tar.bz2 timeline-5189c65192874c0ee7a69449941056294ecd8517.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); |