aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-03-04 19:58:48 +0800
committercrupest <crupest@outlook.com>2019-03-04 19:58:48 +0800
commit1715b3a618ddffc28177e58ae21c91b30d586ccf (patch)
tree3bef8b64aea0792c3b415fa9236837afd1a2577e /Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts
parent80343fab6624f74f0777968dd213c3a26e65890d (diff)
parent8033d6523885486c24af2bdd57a24b0fd62d0b00 (diff)
downloadtimeline-1715b3a618ddffc28177e58ae21c91b30d586ccf.tar.gz
timeline-1715b3a618ddffc28177e58ae21c91b30d586ccf.tar.bz2
timeline-1715b3a618ddffc28177e58ae21c91b30d586ccf.zip
Merge branch 'master' into user
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.ts36
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],