From 558c99702e9ae599d68b2f35c0948d3f0e6a3ada Mon Sep 17 00:00:00 2001 From: "Lisa Flinn (She/Her)" Date: Fri, 10 May 2024 13:34:58 +0100 Subject: [PATCH] initial fix --- src/app/components/dialog/dialog.spec.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/app/components/dialog/dialog.spec.ts b/src/app/components/dialog/dialog.spec.ts index 099d2af2da6..f55d375ba73 100755 --- a/src/app/components/dialog/dialog.spec.ts +++ b/src/app/components/dialog/dialog.spec.ts @@ -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();