diff --git a/src/useCallViewKeyboardShortcuts.test.tsx b/src/useCallViewKeyboardShortcuts.test.tsx index 3c51df03..8d7118db 100644 --- a/src/useCallViewKeyboardShortcuts.test.tsx +++ b/src/useCallViewKeyboardShortcuts.test.tsx @@ -25,8 +25,6 @@ import { useCallViewKeyboardShortcuts } from "../src/useCallViewKeyboardShortcut // Test Explanation: // - The main objective is to test `useCallViewKeyboardShortcuts`. // The TestComponent just wraps a button around that hook. -// - We need to set `userEvent` to the `{document = window.document}` since we are testing the -// `useCallViewKeyboardShortcuts` hook here. Which is listening to window. interface TestComponentProps { setMicrophoneMuted: (muted: boolean) => void; @@ -52,7 +50,7 @@ const TestComponent: FC = ({ }; test("spacebar unmutes", async () => { - const user = userEvent.setup({ document: window.document }); + const user = userEvent.setup(); let muted = true; render( { }); test("spacebar prioritizes pressing a button", async () => { - const user = userEvent.setup({ document: window.document }); + const user = userEvent.setup(); const setMuted = vi.fn(); const onClick = vi.fn(); @@ -86,7 +84,7 @@ test("spacebar prioritizes pressing a button", async () => { }); test("unmuting happens in place of the default action", async () => { - const user = userEvent.setup({ document: window.document }); + const user = userEvent.setup(); const defaultPrevented = vi.fn(); // In the real application, we mostly just want the spacebar shortcut to avoid // scrolling the page. But to test that here in JSDOM, we need some kind of diff --git a/vitest.config.js b/vitest.config.js index 43b407b7..d9790f63 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -12,7 +12,6 @@ export default defineConfig((configEnv) => classNameStrategy: "non-scoped", }, }, - isolate: false, setupFiles: ["src/vitest.setup.ts"], coverage: { reporter: ["html", "json"],