From b4b42f22c5320db3f9634889a3254a250a7746f5 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 26 Jun 2020 13:33:49 +0200 Subject: [PATCH] Show component vorgang * The app shows the component vorgang (app-vorgang) * Note: app.component.spec.ts now needs a stub for app-vorgang --- src/app/app.component.html | 1 + src/app/app.component.spec.ts | 7 ++++++- src/app/vorgang/vorgang.component.html | 2 +- src/app/vorgang/vorgang.component.spec.ts | 7 +++++++ src/app/vorgang/vorgang.component.ts | 2 ++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 6213adc..307b719 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1 +1,2 @@

{{title}}

+ diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 1933668..f98a32f 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,11 +1,16 @@ import { TestBed, async } from '@angular/core/testing'; import { AppComponent } from './app.component'; +import {Component} from '@angular/core'; + +@Component({selector: 'app-vorgang', template: ''}) +class VorgangStubComponent {} describe('AppComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ - AppComponent + AppComponent, + VorgangStubComponent ], }).compileComponents(); })); diff --git a/src/app/vorgang/vorgang.component.html b/src/app/vorgang/vorgang.component.html index d5c622f..759f83b 100644 --- a/src/app/vorgang/vorgang.component.html +++ b/src/app/vorgang/vorgang.component.html @@ -1 +1 @@ -

vorgang works!

+

{{vorgang}}

diff --git a/src/app/vorgang/vorgang.component.spec.ts b/src/app/vorgang/vorgang.component.spec.ts index 5623c20..6d671fc 100644 --- a/src/app/vorgang/vorgang.component.spec.ts +++ b/src/app/vorgang/vorgang.component.spec.ts @@ -22,4 +22,11 @@ describe('VorgangComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('should render vorgang', () => { + const fixture = TestBed.createComponent(VorgangComponent); + fixture.detectChanges(); + const compiled = fixture.debugElement.nativeElement; + expect(compiled.querySelector('p').textContent).toContain('Hello world!'); + }); }); diff --git a/src/app/vorgang/vorgang.component.ts b/src/app/vorgang/vorgang.component.ts index 4c8233d..ddcfe43 100644 --- a/src/app/vorgang/vorgang.component.ts +++ b/src/app/vorgang/vorgang.component.ts @@ -7,6 +7,8 @@ import { Component, OnInit } from '@angular/core'; }) export class VorgangComponent implements OnInit { + vorgang = "Hello world!"; + constructor() { } ngOnInit(): void { -- 2.20.1