Skip to content

Commit 9fdd5c5

Browse files
committed
test: add showContextMenu test for useRoomListItemViewModel
1 parent 318ad22 commit 9fdd5c5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/unit-tests/components/viewmodels/roomlist/RoomListItemViewModel-test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ describe("RoomListItemViewModel", () => {
7373
);
7474
});
7575

76+
it("should show context menu if user has access to options menu", async () => {
77+
mocked(hasAccessToOptionsMenu).mockReturnValue(true);
78+
const { result: vm } = renderHook(
79+
() => useRoomListItemViewModel(room),
80+
withClientContextRenderOptions(room.client),
81+
);
82+
expect(vm.current.showContextMenu).toBe(true);
83+
});
84+
7685
it("should show hover menu if user has access to options menu", async () => {
7786
mocked(hasAccessToOptionsMenu).mockReturnValue(true);
7887
const { result: vm } = renderHook(

0 commit comments

Comments
 (0)