Room list: fix *Chat moved* toast appearing when room list is loaded (#34305)

* Fix Chat moved toast appearing when room list is loaded

* Update e2e tests
This commit is contained in:
Florian Duros
2026-07-16 18:20:42 +00:00
committed by GitHub
parent 7ad619e693
commit 377534e6e9
5 changed files with 22 additions and 9 deletions
@@ -13,6 +13,7 @@ import type { MatrixClient } from "matrix-js-sdk/src/matrix";
import type { RoomNotificationState } from "../../../../src/stores/notifications/RoomNotificationState";
import {
LISTS_UPDATE_EVENT,
ROOM_TAGGED_EVENT,
SECTION_CREATED_EVENT,
RoomListStoreV3Class,
type Section,
@@ -346,6 +347,19 @@ describe("RoomListStoreV3", () => {
expect(fn).toHaveBeenCalled();
});
it("emits ROOM_TAGGED_EVENT on a local user tag action", async () => {
const { store, dispatcher } = await getRoomListStore();
const fn = jest.fn();
store.on(ROOM_TAGGED_EVENT, fn);
dispatcher.dispatch(
{
action: "RoomListActions.tagRoom.success",
},
true,
);
expect(fn).toHaveBeenCalled();
});
it("Room is re-inserted on decryption", async () => {
const { store, rooms, client, dispatcher } = await getRoomListStore();
jest.spyOn(client, "getRoom").mockImplementation(() => rooms[10]);