Skip to content

Commit

Permalink
Merge pull request #15527 from RogueTea/fix-dialog-broken-test
Browse files Browse the repository at this point in the history
Dialog: Fix broken unit test
  • Loading branch information
cetincakiroglu authored May 14, 2024
2 parents 22418a4 + 558c997 commit 0e5bb52
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/app/components/dialog/dialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,7 @@ describe('Dialog', () => {
fixture.detectChanges();

tick(300);
const escapeEvent: any = document.createEvent('CustomEvent');
escapeEvent.which = 27;
escapeEvent.initEvent('keydown', true, true);
document.dispatchEvent(escapeEvent);
document.dispatchEvent(escapeEvent as KeyboardEvent);
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
fixture.detectChanges();

expect(closeSpy).toHaveBeenCalled();
Expand Down

0 comments on commit 0e5bb52

Please sign in to comment.