-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinput-label.component.spec.ts
More file actions
35 lines (27 loc) · 1015 Bytes
/
input-label.component.spec.ts
File metadata and controls
35 lines (27 loc) · 1015 Bytes
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
import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
import {InputLabelComponent} from './input-label.component';
describe('InputLabelComponent', () => {
let component: InputLabelComponent;
let fixture: ComponentFixture<InputLabelComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [InputLabelComponent]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(InputLabelComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should insert the provided text into the component', waitForAsync(() => {
const anyLabelText = 'Any random label';
component.text = anyLabelText;
fixture.detectChanges();
const compile = fixture.debugElement.nativeElement;
const span = compile.querySelector('span');
expect(span.textContent).toEqual(anyLabelText);
}));
});