forked from juristr/angular-testing-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamic-styles.component.spec.ts
More file actions
33 lines (27 loc) · 979 Bytes
/
dynamic-styles.component.spec.ts
File metadata and controls
33 lines (27 loc) · 979 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
/* tslint:disable:no-unused-variable */
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { customMatchers, expect } from '../utils/custom-matchers';
import { DynamicStylesComponent } from './dynamic-styles.component';
describe('DynamicStylesComponent', () => {
let component: DynamicStylesComponent;
let fixture: ComponentFixture<DynamicStylesComponent>;
beforeEach(async(() => {
jasmine.addMatchers(customMatchers);
TestBed.configureTestingModule({
declarations: [DynamicStylesComponent]
});
}));
beforeEach(() => {
fixture = TestBed.createComponent(DynamicStylesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should correctly set the background style', () => {
expect(fixture.debugElement.children[0].nativeElement).toHaveStyle({
'background-color': 'black'
});
});
});