diff --git a/src/lib/bottom-sheet/bottom-sheet.spec.ts b/src/lib/bottom-sheet/bottom-sheet.spec.ts index f473a329858..0d2bda257de 100644 --- a/src/lib/bottom-sheet/bottom-sheet.spec.ts +++ b/src/lib/bottom-sheet/bottom-sheet.spec.ts @@ -582,18 +582,18 @@ describe('MatBottomSheet', () => { viewContainerFixture.detectChanges(); flushMicrotasks(); - expect(document.activeElement.id) + expect(document.activeElement!.id) .not.toBe('bottom-sheet-trigger', 'Expected the focus to change when sheet was opened.'); bottomSheetRef.dismiss(); - expect(document.activeElement.id).not.toBe('bottom-sheet-trigger', + expect(document.activeElement!.id).not.toBe('bottom-sheet-trigger', 'Expcted the focus not to have changed before the animation finishes.'); flushMicrotasks(); viewContainerFixture.detectChanges(); tick(500); - expect(document.activeElement.id).not.toBe('bottom-sheet-trigger', + expect(document.activeElement!.id).not.toBe('bottom-sheet-trigger', 'Expected the trigger not to be refocused on close.'); document.body.removeChild(button);