diff --git a/src/hooks/test/use-click-away-test.js b/src/hooks/test/use-click-away-test.js index 19740dae..a163ae35 100644 --- a/src/hooks/test/use-click-away-test.js +++ b/src/hooks/test/use-click-away-test.js @@ -12,7 +12,8 @@ describe('useClickAway', () => { // Create a fake component to mount in tests that uses the hook function FakeComponent({ enabled = true }) { const myRef = useRef(); - useClickAway(myRef, handler, { enabled }); + const hookOpts = enabled === true ? undefined : { enabled }; + useClickAway(myRef, handler, hookOpts); return (
diff --git a/src/hooks/test/use-focus-away-test.js b/src/hooks/test/use-focus-away-test.js index 3beec103..cfa1bfc0 100644 --- a/src/hooks/test/use-focus-away-test.js +++ b/src/hooks/test/use-focus-away-test.js @@ -12,7 +12,8 @@ describe('useFocusAway', () => { // Create a fake component to mount in tests that uses the hook function FakeComponent({ enabled = true }) { const myRef = useRef(); - useFocusAway(myRef, handler, { enabled }); + const hookOpts = enabled === true ? undefined : { enabled }; + useFocusAway(myRef, handler, hookOpts); return (
diff --git a/src/hooks/test/use-key-press-test.js b/src/hooks/test/use-key-press-test.js index 70880e8b..408a866d 100644 --- a/src/hooks/test/use-key-press-test.js +++ b/src/hooks/test/use-key-press-test.js @@ -17,7 +17,8 @@ describe('useKeyPress', () => { // Create a fake component to mount in tests that uses the hook function FakeComponent({ keys = defaultKeys, enabled = true }) { const myRef = useRef(); - useKeyPress(keys, handler, { enabled }); + const hookOpts = enabled === true ? undefined : { enabled }; + useKeyPress(keys, handler, hookOpts); return (