import { ComponentFixture , TestBed , async } from '@angular/core/testing' ; import { BannerComponent } from './banner.component' ; describe ( 'BannerComponent' , ( ) => { let component ; let fixture ; beforeEach ( async ( ( ) => { TestBed . configureTestingModule ( { declarations : [ BannerComponent ] } ) . compileComponents ( ) ; } ) ) ; beforeEach ( ( ) => { fixture = TestBed . createComponent ( BannerComponent ) ; component = fixture . componentInstance ; } ) ; it ( 'should create' , ( ) => { expect ( component ) . toBeTruthy ( ) ; } ) ; it ( 'should contain "banner works!"' , ( ) => { const bannerElement = fixture . nativeElement ; expect ( bannerElement . textContent ) . toContain ( 'banner works!' ) ; } ) ; it ( 'should have <p> with "banner works!"' , ( ) => { const bannerElement = fixture . nativeElement ; const p = bannerElement . querySelector ( 'p' ) ; expect ( p . textContent ) . toEqual ( 'banner works!' ) ; } ) ; } ) ;