Show component vorgang
[examples/angular-tour-of-heroes] / src / app / app.component.spec.ts
1 import { TestBed, async } from '@angular/core/testing';
2 import { AppComponent } from './app.component';
3 import {Component} from '@angular/core';
4
5 @Component({selector: 'app-vorgang', template: ''})
6 class VorgangStubComponent {}
7
8 describe('AppComponent', () => {
9   beforeEach(async(() => {
10     TestBed.configureTestingModule({
11       declarations: [
12         AppComponent,
13         VorgangStubComponent
14       ],
15     }).compileComponents();
16   }));
17
18   it('should create the app', () => {
19     const fixture = TestBed.createComponent(AppComponent);
20     const app = fixture.debugElement.componentInstance;
21     expect(app).toBeTruthy();
22   });
23
24   it(`should show expected title`, () => {
25     const fixture = TestBed.createComponent(AppComponent);
26     const app = fixture.debugElement.componentInstance;
27     expect(app.title).toEqual('LVM - Camunda-Beispiel');
28   });
29
30   it('should render title', () => {
31     const fixture = TestBed.createComponent(AppComponent);
32     fixture.detectChanges();
33     const compiled = fixture.debugElement.nativeElement;
34     expect(compiled.querySelector('h1').textContent).toContain('LVM - Camunda-Beispiel');
35   });
36 });