beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ BannerComponent ], }) .compileComponents() .then(() => { fixture = TestBed.createComponent(BannerComponent); component = fixture.componentInstance; h1 = fixture.nativeElement.querySelector('h1'); }); }));