From e0a73a020e4e50a1d58e3898cd68664dcd3e91c5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Jun 2025 17:01:02 +0100 Subject: [PATCH] Add snapshot --- .../RoomListPanel/RoomListItemView-test.tsx | 4 + .../RoomListItemView-test.tsx.snap | 123 ++++++++++++++++++ 2 files changed, 127 insertions(+) diff --git a/test/unit-tests/components/views/rooms/RoomListPanel/RoomListItemView-test.tsx b/test/unit-tests/components/views/rooms/RoomListPanel/RoomListItemView-test.tsx index 914d33ee18..eda1a80514 100644 --- a/test/unit-tests/components/views/rooms/RoomListPanel/RoomListItemView-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomListPanel/RoomListItemView-test.tsx @@ -89,6 +89,10 @@ describe("", () => { await user.hover(listItem); await waitFor(() => expect(screen.getByRole("button", { name: "More Options" })).toBeInTheDocument()); + + // also make another snapshot in the hover state (mostly to test the aria-describedBy on the buttons + // as there's no easy way to get the effective ARIA description in react testing library, surprisingly) + expect(listItem).toMatchSnapshot(); }); test("should hover decoration if focused", async () => { diff --git a/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListItemView-test.tsx.snap b/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListItemView-test.tsx.snap index 30edbfde50..138190f2a7 100644 --- a/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListItemView-test.tsx.snap +++ b/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/RoomListItemView-test.tsx.snap @@ -124,6 +124,129 @@ exports[` should display notification decoration 1`] = ` `; +exports[` should hover decoration if hovered 1`] = ` + + + + + + +`; + exports[` should render a room item 1`] = `