diff options
author | crupest <crupest@outlook.com> | 2019-04-13 13:03:18 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-13 13:03:18 +0800 |
commit | fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07 (patch) | |
tree | 39cf181a18a3dc443dbab5669a04d0a23cdefd00 /Timeline/ClientApp/src/app/todo/todo-item | |
parent | 8c5e7069d2651fb6fae641dfe482d7a0910b3fd1 (diff) | |
download | timeline-fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07.tar.gz timeline-fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07.tar.bz2 timeline-fac5006e7eaf7f7bc23e92a2b3059d4f1b37fa07.zip |
Init separate.
Diffstat (limited to 'Timeline/ClientApp/src/app/todo/todo-item')
4 files changed, 0 insertions, 92 deletions
diff --git a/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.css b/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.css deleted file mode 100644 index dcf25fd8..00000000 --- a/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.css +++ /dev/null @@ -1,25 +0,0 @@ -.item-card { - padding: 0; - display: flex; - overflow: hidden; -} - -.item-body-box { - margin: 5px!important -} - -.item-color-block { - width: 15px; - align-self: stretch; - flex: 0 0 auto; -} - -.item-title { - vertical-align: middle; -} - -.item-detail-button { - width: unset; - height: unset; - line-height: unset; -} diff --git a/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.html b/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.html deleted file mode 100644 index 6f76e73b..00000000 --- a/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.html +++ /dev/null @@ -1,9 +0,0 @@ -<mat-card class="mat-elevation-z2 item-card"> - <span class="item-color-block" [class.color-block-closed]="item.isClosed" [class.color-block-open]="!item.isClosed"></span> - <div class="mat-h3 item-body-box"> - <span class="item-title">{{ item.number }}. {{ item.title }}</span> - <a mat-icon-button class="item-detail-button" [href]="item.detailUrl"> - <mat-icon>arrow_forward</mat-icon> - </a> - </div> -</mat-card> diff --git a/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.spec.ts b/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.spec.ts deleted file mode 100644 index 239ffc42..00000000 --- a/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; - -import { TodoItem } from '../todo-item'; -import { TodoItemComponent } from '../todo-item/todo-item.component'; - -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); - }); -}); diff --git a/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.ts b/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.ts deleted file mode 100644 index b5c51229..00000000 --- a/Timeline/ClientApp/src/app/todo/todo-item/todo-item.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component, Input } from '@angular/core'; - -import { TodoItem } from '../todo-item'; - -@Component({ - selector: 'app-todo-item', - templateUrl: './todo-item.component.html', - styleUrls: ['./todo-item.component.css', '../todo-list-color-block.css'] -}) -export class TodoItemComponent { - @Input() item!: TodoItem; -} |