Fix spotlight opening in TAC (#12315)
* Fix spotlight opening in TAC * Add tests * Remove `RovingTabIndexProvider`
This commit is contained in:
parent
70365c891b
commit
ddbc6439ce
4 changed files with 95 additions and 31 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue