Skip to content

Commit 72f4cb9

Browse files
committed
fix: delete isClient
1 parent f9c743f commit 72f4cb9

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

tests/useOrientation.test.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { act, renderHook } from '@testing-library/react-hooks';
2-
import { replaceRaf } from 'raf-stub';
3-
import useOrientation from '../src/useOrientation';
4-
import { isClient } from '../src/util';
1+
import { act, renderHook } from "@testing-library/react-hooks";
2+
import { replaceRaf } from "raf-stub";
3+
import useOrientation from "../src/useOrientation";
54

65
declare var requestAnimationFrame: {
76
reset: () => void;
@@ -55,17 +54,7 @@ describe('useOrientation', () => {
5554
expect(hook.result.current.angle).toBe(0);
5655
});
5756

58-
it('should use passed parameters as initial values in case of non-browser use', () => {
59-
const hook = getHook({
60-
angle: 90,
61-
type: 'portrait-primary'
62-
});
63-
64-
expect(hook.result.current.type).toBe(isClient ? window.screen.orientation.type : 'portrait-primary');
65-
expect(hook.result.current.angle).toBe(isClient ? window.screen.orientation.angle : 90);
66-
});
67-
68-
it('should re-render after orientation change on closest RAF', () => {
57+
it("should re-render after orientation change on closest RAF", () => {
6958
const hook = getHook();
7059

7160
act(() => {

0 commit comments

Comments
 (0)