-
Notifications
You must be signed in to change notification settings - Fork 112
/
input.component.spec.ts
35 lines (28 loc) · 1015 Bytes
/
input.component.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* tslint:disable:no-unused-variable */
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { InputComponent } from './input.component';
describe('InputComponent', () => {
let component: InputComponent;
let fixture: ComponentFixture<InputComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [InputComponent]
});
}));
beforeEach(() => {
fixture = TestBed.createComponent(InputComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should correctly render the passed @Input value', () => {
// there shouldn't be any value initially
expect(fixture.debugElement.nativeElement.innerHTML).toBe('');
// let's set the @Input value and then verify again
component.message = 'Hi there';
fixture.detectChanges();
expect(fixture.debugElement.nativeElement.innerHTML).toBe('Hi there');
});
});