diff --git a/test/components/views/messages/__snapshots__/DateSeparator-test.tsx.snap b/test/components/views/messages/__snapshots__/DateSeparator-test.tsx.snap index 2294a40a995..b75f507bf2e 100644 --- a/test/components/views/messages/__snapshots__/DateSeparator-test.tsx.snap +++ b/test/components/views/messages/__snapshots__/DateSeparator-test.tsx.snap @@ -42,6 +42,7 @@ exports[`DateSeparator when feature_jump_to_date is enabled renders the date sep aria-haspopup="true" aria-label="Jump to date" class="mx_AccessibleButton mx_DateSeparator_jumpToDateMenu mx_DateSeparator_dateContent" + data-state="closed" data-testid="jump-to-date-separator-button" role="button" tabindex="0" diff --git a/test/components/views/rooms/RoomList-test.tsx b/test/components/views/rooms/RoomList-test.tsx index d92b25e347c..93275776137 100644 --- a/test/components/views/rooms/RoomList-test.tsx +++ b/test/components/views/rooms/RoomList-test.tsx @@ -89,10 +89,10 @@ describe("RoomList", () => { const { rerender } = render(getComponent()); const roomsList = screen.getByRole("group", { name: "Rooms" }); - const addRoomButton = within(roomsList).getByRole("button", { name: "Add room" }); + const getAddRoomButton = () => within(roomsList).getByRole("button", { name: "Add room" }); expect(screen.queryByRole("menu")).not.toBeInTheDocument(); - await userEvent.click(addRoomButton); + await userEvent.click(getAddRoomButton()); const menu = screen.getByRole("menu"); @@ -102,7 +102,7 @@ describe("RoomList", () => { disabled = [UIComponent.CreateRooms]; rerender(getComponent()); - expect(addRoomButton).toBeInTheDocument(); + expect(getAddRoomButton()).toBeInTheDocument(); expect(menu).toBeInTheDocument(); expect(within(menu).queryByRole("menuitem", { name: "New room" })).not.toBeInTheDocument(); expect(within(menu).getByRole("menuitem", { name: "Explore public rooms" })).toBeInTheDocument(); @@ -110,7 +110,7 @@ describe("RoomList", () => { disabled = [UIComponent.ExploreRooms]; rerender(getComponent()); - expect(addRoomButton).toBeInTheDocument(); + expect(getAddRoomButton()).toBeInTheDocument(); expect(menu).toBeInTheDocument(); expect(within(menu).getByRole("menuitem", { name: "New room" })).toBeInTheDocument(); expect(within(menu).queryByRole("menuitem", { name: "Explore public rooms" })).not.toBeInTheDocument(); @@ -163,10 +163,10 @@ describe("RoomList", () => { const { rerender } = render(getComponent()); const roomsList = screen.getByRole("group", { name: "Rooms" }); - const addRoomButton = within(roomsList).getByRole("button", { name: "Add room" }); + const getAddRoomButton = () => within(roomsList).getByRole("button", { name: "Add room" }); expect(screen.queryByRole("menu")).not.toBeInTheDocument(); - await userEvent.click(addRoomButton); + await userEvent.click(getAddRoomButton()); const menu = screen.getByRole("menu"); @@ -177,7 +177,7 @@ describe("RoomList", () => { disabled = [UIComponent.CreateRooms]; rerender(getComponent()); - expect(addRoomButton).toBeInTheDocument(); + expect(getAddRoomButton()).toBeInTheDocument(); expect(menu).toBeInTheDocument(); expect(within(menu).getByRole("menuitem", { name: "Explore rooms" })).toBeInTheDocument(); expect(within(menu).queryByRole("menuitem", { name: "New room" })).not.toBeInTheDocument(); @@ -186,7 +186,7 @@ describe("RoomList", () => { disabled = [UIComponent.ExploreRooms]; rerender(getComponent()); - expect(addRoomButton).toBeInTheDocument(); + expect(getAddRoomButton()).toBeInTheDocument(); expect(menu).toBeInTheDocument(); expect(within(menu).queryByRole("menuitem", { name: "Explore rooms" })).toBeInTheDocument(); expect(within(menu).getByRole("menuitem", { name: "New room" })).toBeInTheDocument(); diff --git a/test/components/views/rooms/__snapshots__/RoomTile-test.tsx.snap b/test/components/views/rooms/__snapshots__/RoomTile-test.tsx.snap index 0a96c2cc650..e15e73bba59 100644 --- a/test/components/views/rooms/__snapshots__/RoomTile-test.tsx.snap +++ b/test/components/views/rooms/__snapshots__/RoomTile-test.tsx.snap @@ -59,6 +59,7 @@ exports[`RoomTile when message previews are enabled and there is a message in a aria-haspopup="true" aria-label="Room options" class="mx_AccessibleButton mx_RoomTile_menuButton" + data-state="closed" role="button" tabindex="0" /> @@ -67,6 +68,7 @@ exports[`RoomTile when message previews are enabled and there is a message in a aria-haspopup="true" aria-label="Notification options" class="mx_AccessibleButton mx_RoomTile_notificationsButton" + data-state="closed" role="button" tabindex="-1" /> @@ -141,6 +143,7 @@ exports[`RoomTile when message previews are enabled and there is a message in th aria-haspopup="true" aria-label="Room options" class="mx_AccessibleButton mx_RoomTile_menuButton" + data-state="closed" role="button" tabindex="0" /> @@ -149,6 +152,7 @@ exports[`RoomTile when message previews are enabled and there is a message in th aria-haspopup="true" aria-label="Notification options" class="mx_AccessibleButton mx_RoomTile_notificationsButton" + data-state="closed" role="button" tabindex="-1" /> @@ -204,6 +208,7 @@ exports[`RoomTile when message previews are enabled should render a room without aria-haspopup="true" aria-label="Room options" class="mx_AccessibleButton mx_RoomTile_menuButton" + data-state="closed" role="button" tabindex="0" /> @@ -212,6 +217,7 @@ exports[`RoomTile when message previews are enabled should render a room without aria-haspopup="true" aria-label="Notification options" class="mx_AccessibleButton mx_RoomTile_notificationsButton" + data-state="closed" role="button" tabindex="-1" /> @@ -266,6 +272,7 @@ exports[`RoomTile when message previews are not enabled should render the room 1 aria-haspopup="true" aria-label="Room options" class="mx_AccessibleButton mx_RoomTile_menuButton" + data-state="closed" role="button" tabindex="0" /> @@ -274,6 +281,7 @@ exports[`RoomTile when message previews are not enabled should render the room 1 aria-haspopup="true" aria-label="Notification options" class="mx_AccessibleButton mx_RoomTile_notificationsButton" + data-state="closed" role="button" tabindex="-1" /> diff --git a/test/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap b/test/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap index 24412b1f779..e047e071469 100644 --- a/test/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap +++ b/test/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap @@ -77,6 +77,7 @@ exports[` should show all activated MetaSpaces in the correct orde aria-haspopup="true" aria-label="Options" class="mx_AccessibleButton mx_SpaceButton_menuButton" + data-state="closed" role="button" tabindex="0" />