blob: 5c37eed95eed6bca9aacaa3ab81695790990b2fe [file] [log] [blame]
Sean Condon87b78502018-09-17 20:53:24 +01001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17import { TestBed, async } from '@angular/core/testing';
18import { AppComponent } from './app.component';
19describe('AppComponent', () => {
20 beforeEach(async(() => {
21 TestBed.configureTestingModule({
22 declarations: [
23 AppComponent
24 ],
25 }).compileComponents();
26 }));
27 it('should create the app', async(() => {
28 const fixture = TestBed.createComponent(AppComponent);
29 const app = fixture.debugElement.componentInstance;
30 expect(app).toBeTruthy();
31 }));
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');
36 }));
37 it('should render title in a h1 tag', async(() => {
38 const fixture = TestBed.createComponent(AppComponent);
39 fixture.detectChanges();
40 const compiled = fixture.debugElement.nativeElement;
41 expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
42 }));
43});