Skip to content

Commit

Permalink
Fix comment-editor.component tests (#1200)
Browse files Browse the repository at this point in the history
Fix comment-editor.component tests

Async tests in `comment-editor.component.spec.ts` never fail even when
written to intentionally fail.

Let's fix the tests so that they fail when they should.
  • Loading branch information
chia-yh authored Aug 15, 2023
1 parent a1a8814 commit f4c136c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('CommentEditor', () => {
buttonDe.nativeElement.click();

fixture.detectChanges();
fixture.whenStable().then(() => {
await fixture.whenStable().then(() => {
const textBox: any = debugElement.query(By.css('textarea')).nativeElement;
expect(textBox.value).toEqual(expectedMarkup);
});
Expand Down Expand Up @@ -151,7 +151,7 @@ describe('CommentEditor', () => {
buttonDe.nativeElement.click();
fixture.detectChanges();

fixture.whenStable().then(() => {
await fixture.whenStable().then(() => {
expect(textBoxDe.nativeElement.value).toEqual(expectedMarkup);
});
});
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('CommentEditor', () => {
textBox.value = '123';
textBox.dispatchEvent(new Event('input'));

fixture.whenStable().then(() => {
await fixture.whenStable().then(() => {
expect(textBox.value).toEqual('123');
});
});
Expand Down

0 comments on commit f4c136c

Please sign in to comment.