From 6b1b316ce464ae37e9c32154af8d163364be143f Mon Sep 17 00:00:00 2001 From: Timo K Date: Mon, 27 Apr 2026 18:15:29 +0200 Subject: [PATCH] fix tests --- src/useCallViewKeyboardShortcuts.test.tsx | 26 ++++++++++++----------- src/useCallViewKeyboardShortcuts.ts | 15 ++++++++++--- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/useCallViewKeyboardShortcuts.test.tsx b/src/useCallViewKeyboardShortcuts.test.tsx index 5a327f83..b002c23e 100644 --- a/src/useCallViewKeyboardShortcuts.test.tsx +++ b/src/useCallViewKeyboardShortcuts.test.tsx @@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { render } from "@testing-library/react"; -import { type FC, useRef, useState } from "react"; +import { type FC, useState } from "react"; import { expect, test, vi } from "vitest"; import { Button } from "@vector-im/compound-web"; import userEvent from "@testing-library/user-event"; @@ -39,9 +39,7 @@ const TestComponent: FC = ({ initialModalOpen = false, }) => { const [modalOpen, setModalOpen] = useState(initialModalOpen); - const ref = useRef(null); useCallViewKeyboardShortcuts( - ref, () => {}, () => {}, setAudioEnabled, @@ -49,8 +47,11 @@ const TestComponent: FC = ({ toggleHandRaised, ); return ( -
- + <> +
+ +
+ {/*// modal lives outside of the root*/} {modalOpen && ( = ({ )} -
+ ); }; @@ -164,12 +165,13 @@ test("unmuting happens in place of the default action", async () => { // container element that can be interactive and receive focus / keydown // events.