2 * Copyright (c) 2017 ZTE Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * and the Apache License 2.0 which both accompany this distribution,
6 * and are available at http://www.eclipse.org/legal/epl-v10.html
7 * and http://www.apache.org/licenses/LICENSE-2.0
10 * ZTE - initial API and implementation and/or initial documentation
13 import { TestBed, async } from '@angular/core/testing';
15 import { AppComponent } from './app.component';
17 describe('AppComponent', () => {
18 beforeEach(async(() => {
19 TestBed.configureTestingModule({
23 }).compileComponents();
26 it('should create the app', async(() => {
27 const fixture = TestBed.createComponent(AppComponent);
28 const app = fixture.debugElement.componentInstance;
29 expect(app).toBeTruthy();
32 it(`should have as title 'app'`, async(() => {
33 const fixture = TestBed.createComponent(AppComponent);
34 const app = fixture.debugElement.componentInstance;
35 expect(app.title).toEqual('app');
38 it('should render title in a h1 tag', async(() => {
39 const fixture = TestBed.createComponent(AppComponent);
40 fixture.detectChanges();
41 const compiled = fixture.debugElement.nativeElement;
42 expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');