aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-02-22 13:37:03 +0000
committer杨宇千 <crupest@outlook.com>2019-02-22 13:37:03 +0000
commit25e606b67506b3bc0242414aebe472f13a02bd9c (patch)
treeb26ed67c18a5dd4a36452e2e536b48524eae0e54 /Timeline/ClientApp/src/app
parent9ae2a899eb53b8ee31710a5533cdf21b0f14dafd (diff)
parent00814dccd8f26a6dd9cc9163fad05afafb1ae4e6 (diff)
downloadtimeline-25e606b67506b3bc0242414aebe472f13a02bd9c.tar.gz
timeline-25e606b67506b3bc0242414aebe472f13a02bd9c.tar.bz2
timeline-25e606b67506b3bc0242414aebe472f13a02bd9c.zip
Merged PR 4: Some minor efforts.
Related work items: #1
Diffstat (limited to 'Timeline/ClientApp/src/app')
-rw-r--r--Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.spec.ts18
-rw-r--r--Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts3
2 files changed, 11 insertions, 10 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 7fc4164d..e01e91fb 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
@@ -1,5 +1,5 @@
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
-import { async, ComponentFixture, TestBed, tick } from '@angular/core/testing';
+import { async, ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
import { defer, Observable } from 'rxjs';
@@ -8,7 +8,8 @@ import { TodoListService, WorkItem } from './todo-list.service';
import { By } from '@angular/platform-browser';
@Component({
- selector: 'mat-progress-bar',
+/* tslint:disable-next-line:component-selector*/
+selector: 'mat-progress-bar',
template: ''
})
class MatProgressBarStubComponent {
@@ -45,21 +46,22 @@ describe('TodoListPageComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(TodoListPageComponent);
component = fixture.componentInstance;
- fixture.detectChanges();
});
it('should create', () => {
+ fixture.detectChanges();
expect(component).toBeTruthy();
});
it('should show progress bar during loading', () => {
+ fixture.detectChanges();
expect(fixture.debugElement.query(By.css('mat-progress-bar'))).toBeTruthy();
});
- it('should hide progress bar after loading', async(() => {
- fixture.whenStable().then(() => {
- fixture.detectChanges();
- expect(fixture.debugElement.query(By.css('mat-progress-bar'))).toBeFalsy();
- });
+ it('should hide progress bar after loading', fakeAsync(() => {
+ fixture.detectChanges();
+ tick();
+ fixture.detectChanges();
+ expect(fixture.debugElement.query(By.css('mat-progress-bar'))).toBeFalsy();
}));
});
diff --git a/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts b/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts
index 8af1f5ef..06f49923 100644
--- a/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts
+++ b/Timeline/ClientApp/src/app/todo-list-page/todo-list-page.component.ts
@@ -11,10 +11,9 @@ export class TodoListPageComponent implements OnInit {
items: WorkItem[];
constructor(private todoService: TodoListService) {
- todoService.getWorkItemList().subscribe(result => this.items = result);
}
ngOnInit() {
+ this.todoService.getWorkItemList().subscribe(result => this.items = result);
}
-
}