diff options
author | crupest <crupest@outlook.com> | 2019-03-04 19:45:49 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-04 19:45:49 +0800 |
commit | 0ae0459be4f9eade994acbca65a60070672854fb (patch) | |
tree | fd003b7971e34f07d12a32274c9d4a1113b0862a /Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts | |
parent | cd28058f07fda57f6569316723f776f1b9b80e50 (diff) | |
download | timeline-0ae0459be4f9eade994acbca65a60070672854fb.tar.gz timeline-0ae0459be4f9eade994acbca65a60070672854fb.tar.bz2 timeline-0ae0459be4f9eade994acbca65a60070672854fb.zip |
Migrate todo page from Azure DevOps WorkItems to Github Issues.
Diffstat (limited to 'Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts b/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts index a757b2a5..5706bf51 100644 --- a/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts +++ b/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts @@ -4,7 +4,7 @@ import { async, ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core import { Observable, from } from 'rxjs'; import { TodoListPageComponent } from './todo-list-page.component'; -import { TodoListService, WorkItem } from './todo-list.service'; +import { TodoListService, TodoItem } from './todo-list.service'; import { By } from '@angular/platform-browser'; import { delay } from 'rxjs/operators'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; @@ -24,29 +24,25 @@ describe('TodoListPageComponent', () => { let component: TodoListPageComponent; let fixture: ComponentFixture<TodoListPageComponent>; - let mockWorkItems: WorkItem[]; + const mockTodoItems: TodoItem[] = [ + { + number: 0, + title: 'Test title 1', + isClosed: true, + detailUrl: 'test_url1' + }, + { + number: 1, + title: 'Test title 2', + isClosed: false, + detailUrl: 'test_url2' + } + ]; beforeEach(async(() => { const todoListService: jasmine.SpyObj<TodoListService> = jasmine.createSpyObj('TodoListService', ['getWorkItemList']); - mockWorkItems = [ - { - id: 0, - title: 'Test title 1', - isCompleted: true, - detailUrl: 'https://test.org/workitems/0', - iconUrl: 'https://test.org/icon/0' - }, - { - id: 1, - title: 'Test title 2', - isCompleted: false, - detailUrl: 'https://test.org/workitems/1', - iconUrl: 'https://test.org/icon/1' - } - ]; - - todoListService.getWorkItemList.and.returnValue(asyncArray(mockWorkItems)); + todoListService.getWorkItemList.and.returnValue(asyncArray(mockTodoItems)); TestBed.configureTestingModule({ declarations: [TodoListPageComponent, MatProgressBarStubComponent], |