mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-05 22:25:36 +00:00
New room list: add context menu to room list item (#29952)
* chore: update compound-web * chore: remove unused export * feat: export content of more option menu * feat: add context menu * feat: add `showContextMenu` to vm * feat: use context menu in new room list * test: add tests for room list item * test: fix room list test * test: add `showContextMenu` test for `useRoomListItemViewModel` * test: add e2e test for context menu * chore: update compound * test: update snapshots and e2e test * fix: avoid icon blinking when we reopen the context menu * test: add test for menu closing * doc: remove useless tsdoc param * chore: update `@vector-im/compound-web` * refactor: remove manual focus * test(e2e): fix focus after closing notification menu * doc: remove useless jobs
This commit is contained in:
@@ -10,7 +10,7 @@ import { type MatrixClient } from "matrix-js-sdk/src/matrix";
|
||||
import { render } from "jest-matrix-react";
|
||||
import { fireEvent } from "@testing-library/dom";
|
||||
|
||||
import { mkRoom, stubClient } from "../../../../../test-utils";
|
||||
import { mkRoom, stubClient, withClientContextRenderOptions } from "../../../../../test-utils";
|
||||
import { type RoomListViewState } from "../../../../../../src/components/viewmodels/roomlist/RoomListViewModel";
|
||||
import { RoomList } from "../../../../../../src/components/views/rooms/RoomListPanel/RoomList";
|
||||
import DMRoomMap from "../../../../../../src/utils/DMRoomMap";
|
||||
@@ -44,7 +44,7 @@ describe("<RoomList />", () => {
|
||||
});
|
||||
|
||||
it("should render a room list", () => {
|
||||
const { asFragment } = render(<RoomList vm={vm} />);
|
||||
const { asFragment } = render(<RoomList vm={vm} />, withClientContextRenderOptions(matrixClient));
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -53,7 +53,7 @@ describe("<RoomList />", () => {
|
||||
{ shortcut: { key: "F6", ctrlKey: true }, isPreviousLandmark: false, label: "NextLandmark" },
|
||||
])("should navigate to the landmark on NextLandmark.$label action", ({ shortcut, isPreviousLandmark }) => {
|
||||
const spyFindLandmark = jest.spyOn(LandmarkNavigation, "findAndFocusNextLandmark").mockReturnValue();
|
||||
const { getByTestId } = render(<RoomList vm={vm} />);
|
||||
const { getByTestId } = render(<RoomList vm={vm} />, withClientContextRenderOptions(matrixClient));
|
||||
const roomList = getByTestId("room-list");
|
||||
fireEvent.keyDown(roomList, shortcut);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user