Replace focus_room_filter dispatch by Action.OpenSpotlight (#29259)

* refactor(room search): replace `focus_room_filter` dispatch by `Action.OpenSpotlight`

* test(LoggedInView): add test to Ctrl+k shortcut
This commit is contained in:
Florian D
2025-02-13 16:18:41 +01:00
committed by GitHub
parent 4b9382f888
commit 85f80b1d0a
3 changed files with 9 additions and 20 deletions

View File

@@ -421,6 +421,14 @@ describe("<LoggedInView />", () => {
expect(defaultDispatcher.dispatch).not.toHaveBeenCalledWith({ action: Action.ViewHomePage });
});
it("should open spotlight when Ctrl+k is fired", async () => {
jest.spyOn(defaultDispatcher, "fire");
getComponent();
await userEvent.keyboard("{Control>}k{/Control}");
expect(defaultDispatcher.fire).toHaveBeenCalledWith(Action.OpenSpotlight);
});
describe("timezone updates", () => {
const userTimezone = "Europe/London";
const originalController = SETTINGS["userTimezonePublish"].controller;