import { TestBed, async } from '@angular/core/testing'; import { BrowserModule } from '@angular/platform-browser'; import { APP_BASE_HREF } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpClientModule } from '@angular/common/http'; import { WindowRef } from './core/window-ref.service'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MatButtonModule, MatCheckboxModule, MatInputModule } from '@angular/material'; import 'hammerjs'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ BrowserModule, FormsModule, HttpClientModule, BrowserAnimationsModule, MatButtonModule, MatCheckboxModule, MatInputModule, AppRoutingModule ], declarations: [ AppComponent ], providers: [{provide: APP_BASE_HREF, useValue: '/'}, WindowRef] }).compileComponents(); })); it('should create the app', async(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); })); it(`should have as title 'Tangerine Client v3.x.x'`, async(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app.title).toEqual('Tangerine Client v3.x.x'); })); it('should render title in a h1 tag', async(() => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.debugElement.nativeElement; expect(compiled.querySelector('h1').textContent).toContain('Tangerine Client v3.x.x'); })); });