diff options
author | 杨宇千 <crupest@outlook.com> | 2019-03-04 19:57:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-04 19:57:56 +0800 |
commit | aca753fba19a221f1aec65030ba4aec4bc34f576 (patch) | |
tree | 552cbe6c50573e2d78e323e5d460db989cdd0a77 /Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts | |
parent | 1259f24a7febc35400a10149b72af41dd00617ee (diff) | |
parent | cb58648843160a672ba9427b0abfb2dd87c86206 (diff) | |
download | timeline-aca753fba19a221f1aec65030ba4aec4bc34f576.tar.gz timeline-aca753fba19a221f1aec65030ba4aec4bc34f576.tar.bz2 timeline-aca753fba19a221f1aec65030ba4aec4bc34f576.zip |
Merge pull request #2 from crupest/migrate-todo
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], |