Skip to content

Commit 172d522

Browse files
committed
Added more tests
1 parent d560da9 commit 172d522

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/app/component/top-header/top-header.component.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,19 @@ describe('TopHeaderComponent', () => {
2121
it('should create', () => {
2222
expect(component).toBeTruthy();
2323
});
24+
25+
it('check if header is being generated', () => {
26+
const HTMLElement: HTMLElement = fixture.nativeElement;
27+
const heading = HTMLElement.querySelector('h1')!;
28+
expect(heading.textContent).toEqual('Default');
29+
});
30+
31+
it('check if header is being changed', () => {
32+
const changedTextElement = 'changed';
33+
component.section = changedTextElement;
34+
fixture.detectChanges();
35+
const HTMLElement: HTMLElement = fixture.nativeElement;
36+
const heading = HTMLElement.querySelector('h1')!;
37+
expect(heading.textContent).toEqual('changed');
38+
});
2439
});

0 commit comments

Comments
 (0)