File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed
Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change 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
65declare 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 ( ( ) => {
You can’t perform that action at this time.
0 commit comments