aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-03-06 21:29:36 +0800
committercrupest <crupest@outlook.com>2019-03-06 21:29:36 +0800
commit63735a8267d44892a64da5b599b7c2e20f373464 (patch)
tree7f43f0beb8c465e06e0d1c4d18cadfb77c39bc78 /Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts
parent8ec742c4a00c1732d6aa58a1cb8b628428d23c4a (diff)
downloadtimeline-63735a8267d44892a64da5b599b7c2e20f373464.tar.gz
timeline-63735a8267d44892a64da5b599b7c2e20f373464.tar.bz2
timeline-63735a8267d44892a64da5b599b7c2e20f373464.zip
Reorganize file structure.
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.ts55
1 files changed, 0 insertions, 55 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
deleted file mode 100644
index a2ad0cbd..00000000
--- a/Timeline/ClientApp/src/app/todo-list-page/todo-list.service.spec.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import { TestBed } from '@angular/core/testing';
-import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
-
-import {
- TodoListService, IssueResponse, IssueResponseItem, TodoItem
-} from './todo-list.service';
-import { toArray } from 'rxjs/operators';
-
-
-describe('TodoListServiceService', () => {
- beforeEach(() => TestBed.configureTestingModule({
- imports: [HttpClientTestingModule]
- }));
-
- it('should be created', () => {
- const service: TodoListService = TestBed.get(TodoListService);
- expect(service).toBeTruthy();
- });
-
- it('should work well', () => {
- const service: TodoListService = TestBed.get(TodoListService);
-
- const baseUrl = service.baseUrl;
-
- const mockIssueList: IssueResponse = [{
- number: 1,
- title: 'Issue title 1',
- state: 'open',
- html_url: 'test_url1'
- }, {
- number: 2,
- title: 'Issue title 2',
- state: 'closed',
- html_url: 'test_url2',
- pull_request: {}
- }];
-
- const mockTodoItemList: TodoItem[] = [{
- number: 1,
- title: 'Issue title 1',
- isClosed: false,
- detailUrl: 'test_url1'
- }];
-
- service.getWorkItemList().pipe(toArray()).subscribe(data => {
- expect(data).toEqual(mockTodoItemList);
- });
-
- const httpController: HttpTestingController = TestBed.get(HttpTestingController);
-
- httpController.expectOne(request => request.url === baseUrl + '/issues' && request.params.get('state') === 'all').flush(mockIssueList);
-
- httpController.verify();
- });
-});