diff --git a/tests/useOrientation.test.ts b/tests/useOrientation.test.ts index 58a8392f2b..df45546263 100644 --- a/tests/useOrientation.test.ts +++ b/tests/useOrientation.test.ts @@ -1,6 +1,6 @@ -import { act, renderHook } from "@testing-library/react-hooks"; -import { replaceRaf } from "raf-stub"; -import useOrientation from "../src/useOrientation"; +import { act, renderHook } from '@testing-library/react-hooks'; +import { replaceRaf } from 'raf-stub'; +import useOrientation from '../src/useOrientation'; declare var requestAnimationFrame: { reset: () => void; @@ -18,7 +18,7 @@ describe('useOrientation', () => { angle: 0, }; (window.orientation as number) = 0; - }) + }); afterEach(() => { requestAnimationFrame.reset(); @@ -35,7 +35,7 @@ describe('useOrientation', () => { function triggerOrientation(type: string, angle: number) { (window.screen.orientation.type as string) = type; (window.screen.orientation.angle as number) = angle; - + window.dispatchEvent(new Event('orientationchange')); } @@ -54,7 +54,7 @@ describe('useOrientation', () => { expect(hook.result.current.angle).toBe(0); }); - it("should re-render after orientation change on closest RAF", () => { + it('should re-render after orientation change on closest RAF', () => { const hook = getHook(); act(() => { @@ -70,7 +70,7 @@ describe('useOrientation', () => { (window.screen.orientation as unknown) = undefined; const hook = getHook(); - + expect(hook.result.current.type).toBe(''); expect(hook.result.current.angle).toBe(0); }); @@ -78,10 +78,10 @@ describe('useOrientation', () => { it('should return 0 if window.orientation is not a number and if window.screen.orientation is missing', () => { (window.screen.orientation as unknown) = undefined; (window.orientation as unknown) = null; - + const hook = getHook(); - + expect(hook.result.current.type).toBe(''); expect(hook.result.current.angle).toBe(0); - }) + }); });