diff --git a/test/components/views/beacon/__snapshots__/BeaconListItem-test.tsx.snap b/test/components/views/beacon/__snapshots__/BeaconListItem-test.tsx.snap
index 1d7a958672a5..f3f1eceb5a41 100644
--- a/test/components/views/beacon/__snapshots__/BeaconListItem-test.tsx.snap
+++ b/test/components/views/beacon/__snapshots__/BeaconListItem-test.tsx.snap
@@ -48,6 +48,7 @@ exports[` when a beacon is live and has locations renders beac
diff --git a/test/components/views/beacon/__snapshots__/DialogSidebar-test.tsx.snap b/test/components/views/beacon/__snapshots__/DialogSidebar-test.tsx.snap
index 5ed76727c938..5946edd573b4 100644
--- a/test/components/views/beacon/__snapshots__/DialogSidebar-test.tsx.snap
+++ b/test/components/views/beacon/__snapshots__/DialogSidebar-test.tsx.snap
@@ -82,6 +82,7 @@ exports[` renders sidebar correctly with beacons 1`] = `
diff --git a/test/components/views/beacon/__snapshots__/ShareLatestLocation-test.tsx.snap b/test/components/views/beacon/__snapshots__/ShareLatestLocation-test.tsx.snap
index 068e4b8ca9b3..edebf1b0ebdb 100644
--- a/test/components/views/beacon/__snapshots__/ShareLatestLocation-test.tsx.snap
+++ b/test/components/views/beacon/__snapshots__/ShareLatestLocation-test.tsx.snap
@@ -19,6 +19,7 @@ exports[` renders share buttons when there is a location
diff --git a/test/components/views/dialogs/__snapshots__/DevtoolsDialog-test.tsx.snap b/test/components/views/dialogs/__snapshots__/DevtoolsDialog-test.tsx.snap
index 20b79a2ccbfb..90198f32e86d 100644
--- a/test/components/views/dialogs/__snapshots__/DevtoolsDialog-test.tsx.snap
+++ b/test/components/views/dialogs/__snapshots__/DevtoolsDialog-test.tsx.snap
@@ -41,6 +41,7 @@ exports[`DevtoolsDialog renders the devtools dialog 1`] = `
diff --git a/test/components/views/settings/tabs/room/__snapshots__/AdvancedRoomSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/room/__snapshots__/AdvancedRoomSettingsTab-test.tsx.snap
index 17390e6b00cf..9656af6fd5e7 100644
--- a/test/components/views/settings/tabs/room/__snapshots__/AdvancedRoomSettingsTab-test.tsx.snap
+++ b/test/components/views/settings/tabs/room/__snapshots__/AdvancedRoomSettingsTab-test.tsx.snap
@@ -45,6 +45,7 @@ exports[`AdvancedRoomSettingsTab should render as expected 1`] = `
diff --git a/test/components/views/settings/tabs/user/LabsUserSettingsTab-test.tsx b/test/components/views/settings/tabs/user/LabsUserSettingsTab-test.tsx
index fd9a92a22539..53c269631881 100644
--- a/test/components/views/settings/tabs/user/LabsUserSettingsTab-test.tsx
+++ b/test/components/views/settings/tabs/user/LabsUserSettingsTab-test.tsx
@@ -15,7 +15,8 @@ limitations under the License.
*/
import React from "react";
-import { fireEvent, render, screen } from "@testing-library/react";
+import { render, screen, waitFor } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
import LabsUserSettingsTab from "../../../../../../src/components/views/settings/tabs/user/LabsUserSettingsTab";
import SettingsStore from "../../../../../../src/settings/SettingsStore";
@@ -113,12 +114,14 @@ describe("", () => {
expect(toggle.getAttribute("aria-checked")).toEqual("true");
// Hover over the toggle to make it show the tooltip
- fireEvent.mouseOver(toggle);
-
- const tooltip = rendered.getByRole("tooltip");
- expect(tooltip).toHaveTextContent(
- "Once enabled, Rust cryptography can only be disabled by logging out and in again",
- );
+ await userEvent.hover(toggle);
+
+ await waitFor(() => {
+ const tooltip = screen.getByRole("tooltip");
+ expect(tooltip).toHaveTextContent(
+ "Once enabled, Rust cryptography can only be disabled by logging out and in again",
+ );
+ });
});
});
@@ -150,12 +153,14 @@ describe("", () => {
expect(toggle.getAttribute("aria-checked")).toEqual("true");
// Hover over the toggle to make it show the tooltip
- fireEvent.mouseOver(toggle);
-
- const tooltip = rendered.getByRole("tooltip");
- expect(tooltip).toHaveTextContent(
- "Rust cryptography cannot be disabled on this deployment of BrandedClient",
- );
+ await userEvent.hover(toggle);
+
+ await waitFor(() => {
+ const tooltip = rendered.getByRole("tooltip");
+ expect(tooltip).toHaveTextContent(
+ "Rust cryptography cannot be disabled on this deployment of BrandedClient",
+ );
+ });
});
});
});