/* tslint:disable:no-unused-variable */ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { DebugElement } from '@angular/core'; import { IconModel } from '../../models/icon' import { CfIconComponent } from './icon.component'; describe('CfIconComponent', () => { let component: CfIconComponent; let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ CfIconComponent ] }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(CfIconComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create component', () => { expect(component).toBeTruthy(); }); it('should create default icon', () => { let testIcon = new IconModel({ name: '', type: '', size: '', color: { foreground: '', background: '' } }); expect(component.icon).toEqual(testIcon); }); it('should render icon name in a md-icon tag', () => { expect(component.querySelector('md-icon').textContent).toContain('home'); }); it('should render icon font-size in a md-icon tag', () => { expect(component.querySelector('md-icon').style.fontSize).toContain('24px'); }); it('should render icon width in a md-icon tag', () => { expect(component.querySelector('md-icon').style.width).toContain('24px'); }); it('should render icon height in a md-icon tag', () => { expect(component.querySelector('md-icon').style.height).toContain('24px'); }); });