upload init code and doc for workflow designer
[sdc/sdc-workflow-designer.git] / sdc-workflow-designer-ui / src / app / app.component.spec.ts
1 /**
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
8  *
9  * Contributors:
10  *     ZTE - initial API and implementation and/or initial documentation
11  */
12
13 import { TestBed, async } from '@angular/core/testing';
14
15 import { AppComponent } from './app.component';
16
17 describe('AppComponent', () => {
18   beforeEach(async(() => {
19     TestBed.configureTestingModule({
20       declarations: [
21         AppComponent
22       ],
23     }).compileComponents();
24   }));
25
26   it('should create the app', async(() => {
27     const fixture = TestBed.createComponent(AppComponent);
28     const app = fixture.debugElement.componentInstance;
29     expect(app).toBeTruthy();
30   }));
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
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!');
43   }));
44 });