diff options
author | crupest <crupest@outlook.com> | 2019-03-06 21:29:36 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-06 21:29:36 +0800 |
commit | 63735a8267d44892a64da5b599b7c2e20f373464 (patch) | |
tree | 7f43f0beb8c465e06e0d1c4d18cadfb77c39bc78 /Timeline/ClientApp/src/app/todo-item/todo-item.component.spec.ts | |
parent | 8ec742c4a00c1732d6aa58a1cb8b628428d23c4a (diff) | |
download | timeline-63735a8267d44892a64da5b599b7c2e20f373464.tar.gz timeline-63735a8267d44892a64da5b599b7c2e20f373464.tar.bz2 timeline-63735a8267d44892a64da5b599b7c2e20f373464.zip |
Reorganize file structure.
Diffstat (limited to 'Timeline/ClientApp/src/app/todo-item/todo-item.component.spec.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/todo-item/todo-item.component.spec.ts | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/Timeline/ClientApp/src/app/todo-item/todo-item.component.spec.ts b/Timeline/ClientApp/src/app/todo-item/todo-item.component.spec.ts deleted file mode 100644 index 520b6136..00000000 --- a/Timeline/ClientApp/src/app/todo-item/todo-item.component.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TodoItemComponent } from './todo-item.component'; -import { TodoItem } from '../todo-list-page/todo-list.service'; -import { By } from '@angular/platform-browser'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; - -describe('TodoItemComponent', () => { - let component: TodoItemComponent; - let fixture: ComponentFixture<TodoItemComponent>; - - const mockTodoItem: TodoItem = { - number: 1, - title: 'Title', - isClosed: true, - detailUrl: '/detail', - }; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [TodoItemComponent], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TodoItemComponent); - component = fixture.componentInstance; - component.item = mockTodoItem; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); - - it('should set title', () => { - expect((fixture.debugElement.query(By.css('span.item-title')).nativeElement as HTMLSpanElement).textContent).toBe( - mockTodoItem.number + '. ' + mockTodoItem.title - ); - }); - - it('should set detail link', () => { - expect(fixture.debugElement.query(By.css('a.item-detail-button')).properties['href']).toBe(mockTodoItem.detailUrl); - }); -}); |