import { async , ComponentFixture , TestBed } from '@angular/core/testing' ; import { AlertLevelComponent } from './alert-level.component' ; describe ( 'AlertLevelComponent' , ( ) => { let component ; let fixture ; beforeEach ( async ( ( ) => { TestBed . configureTestingModule ( { declarations : [ AlertLevelComponent ] } ) . compileComponents ( ) ; } ) ) ; beforeEach ( ( ) => { fixture = TestBed . createComponent ( AlertLevelComponent ) ; component = fixture . componentInstance ; fixture . detectChanges ( ) ; } ) ; it ( 'should create' , ( ) => { expect ( component ) . toBeTruthy ( ) ; } ) ; describe ( 'set alert' , ( ) => { it ( 'sets alert level' , ( ) => { component . alert = 'yellow' ; expect ( component . alert ) . toEqual ( 'yellow' ) ; } ) ; } ) ; } ) ;