import { async, TestBed } from '@angular/core/testing'; import { AppRootComponent } from './app-root.page'; describe('AppRootComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ AppRootComponent ], }).compileComponents(); })); it('should create the app', async(() => { const fixture = TestBed.createComponent(AppRootComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); })); it(`should have as title 'civ works!'`, async(() => { const fixture = TestBed.createComponent(AppRootComponent); const app = fixture.debugElement.componentInstance; expect(app.title).toEqual('civ works!'); })); it('should render title in a h1 tag', async(() => { const fixture = TestBed.createComponent(AppRootComponent); fixture.detectChanges(); const compiled = fixture.debugElement.nativeElement; expect(compiled.querySelector('h1').textContent).toContain('civ works!'); })); });