blob: 1808eb6e895d5e694bf435043c2ff6e8f7774a09 [file] [log] [blame]
Sean Condon83fc39f2018-04-19 18:56:13 +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 */
16import { TestBed, async } from '@angular/core/testing';
17import { OnosComponent } from '../../app/onos.component';
18
19/**
20 * ONOS GUI -- Onos Component - Unit Tests
21 */
22describe('OnosComponent', () => {
23 beforeEach(async(() => {
24 TestBed.configureTestingModule({
25 declarations: [
26 OnosComponent
27 ],
28 }).compileComponents();
29 }));
30 it('should create the app', async(() => {
31 const fixture = TestBed.createComponent(OnosComponent);
32 const app = fixture.debugElement.componentInstance;
33 expect(app).toBeTruthy();
34 }));
35 it(`should have as title 'onos'`, async(() => {
36 const fixture = TestBed.createComponent(OnosComponent);
37 const app = fixture.debugElement.componentInstance;
38 expect(app.title).toEqual('onos');
39 }));
40 it('should render title in a h1 tag', async(() => {
41 const fixture = TestBed.createComponent(OnosComponent);
42 fixture.detectChanges();
43 const compiled = fixture.debugElement.nativeElement;
44 expect(compiled.querySelector('h1').textContent).toContain('Welcome to onos!');
45 }));
46});