You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Fix spotlight opening in TAC (#12315)
* Fix spotlight opening in TAC * Add tests * Remove `RovingTabIndexProvider`
This commit is contained in:
@ -180,4 +180,31 @@ describe("ThreadsActivityCentre", () => {
|
||||
|
||||
expect(screen.getByRole("menu")).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("should block Ctrl/CMD + k shortcut", async () => {
|
||||
cli.getVisibleRooms = jest.fn().mockReturnValue([roomWithHighlight]);
|
||||
|
||||
const keyDownHandler = jest.fn();
|
||||
render(
|
||||
<div
|
||||
onKeyDown={(evt) => {
|
||||
keyDownHandler(evt.key, evt.ctrlKey);
|
||||
}}
|
||||
>
|
||||
<MatrixClientContext.Provider value={cli}>
|
||||
<ThreadsActivityCentre />
|
||||
</MatrixClientContext.Provider>
|
||||
</div>,
|
||||
{ wrapper: TooltipProvider },
|
||||
);
|
||||
await userEvent.click(getTACButton());
|
||||
|
||||
// CTRL/CMD + k should be blocked
|
||||
await userEvent.keyboard("{Control>}k{/Control}");
|
||||
expect(keyDownHandler).not.toHaveBeenCalledWith("k", true);
|
||||
|
||||
// Sanity test
|
||||
await userEvent.keyboard("{Control>}a{/Control}");
|
||||
expect(keyDownHandler).toHaveBeenCalledWith("a", true);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user