From fe6d3464569a638df5cfdc10cfe1b6e58ec1b11a Mon Sep 17 00:00:00 2001 From: Anit Nilay Date: Tue, 7 Dec 2021 12:31:01 +0530 Subject: [PATCH] :fire: Fix portal test (#112) --- __tests__/components/Portal/Portal.spec.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/__tests__/components/Portal/Portal.spec.tsx b/__tests__/components/Portal/Portal.spec.tsx index eb9a7a2..473a54a 100644 --- a/__tests__/components/Portal/Portal.spec.tsx +++ b/__tests__/components/Portal/Portal.spec.tsx @@ -29,13 +29,15 @@ describe('Portal', () => { it('should not render if document in not defined', () => { jest.useFakeTimers(); - const document = global.document; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const document = (global as any).document; global.document = undefined; render(portal({})); jest.runAllTimers(); - global.document = document; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (global as any).document = document; jest.runAllTimers(); expect(document.querySelector('sha-el-portal')).toBeDefined();