Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed May 6, 2021
1 parent cf8a820 commit 18b9ea3
Show file tree
Hide file tree
Showing 3 changed files with 286 additions and 91 deletions.
8 changes: 8 additions & 0 deletions frontend/app/framework/angular/title.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,35 @@ describe('TitleComponent', () => {
it('should set title in service', () => {
titleComponent.message = 'title1';

expect().nothing();

titleService.verify(x => x.push('title1', undefined), Times.once());
});

it('should replace title in title service', () => {
titleComponent.message = 'title1';
titleComponent.message = 'title2';

expect().nothing();

titleService.verify(x => x.push('title2', 'title1'), Times.once());
});

it('should remove title on destroy if set before', () => {
titleComponent.message = 'title1';
titleComponent.ngOnDestroy();

expect().nothing();

titleService.verify(x => x.pop(), Times.once());
});

it('should not remove title on destroy if not set before', () => {
titleComponent.message = undefined!;
titleComponent.ngOnDestroy();

expect().nothing();

titleService.verify(x => x.pop(), Times.never());
});
});
Loading

0 comments on commit 18b9ea3

Please sign in to comment.