Fix buttons of widget in a room (#12288)
* Revert 3acd648 - Fix timeline position when moving to a room and coming back
* Fix initialEventId
This commit is contained in:
@@ -711,4 +711,10 @@ describe("RoomView", () => {
|
||||
|
||||
await expect(prom).resolves.toEqual(expect.objectContaining({ room_id: room2.roomId }));
|
||||
});
|
||||
|
||||
it("fires Action.RoomLoaded", async () => {
|
||||
jest.spyOn(dis, "dispatch");
|
||||
await mountRoomView();
|
||||
expect(dis.dispatch).toHaveBeenCalledWith({ action: Action.RoomLoaded });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -137,6 +137,11 @@ describe("RoomViewStore", function () {
|
||||
await untilDispatch(Action.CancelAskToJoin, dis);
|
||||
};
|
||||
|
||||
const dispatchRoomLoaded = async () => {
|
||||
dis.dispatch({ action: Action.RoomLoaded });
|
||||
await untilDispatch(Action.RoomLoaded, dis);
|
||||
};
|
||||
|
||||
let roomViewStore: RoomViewStore;
|
||||
let slidingSyncManager: SlidingSyncManager;
|
||||
let dis: MatrixDispatcher;
|
||||
@@ -423,10 +428,6 @@ describe("RoomViewStore", function () {
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.spyOn(SettingsStore, "getValue").mockReset();
|
||||
});
|
||||
|
||||
it("subscribes to the room", async () => {
|
||||
const setRoomVisible = jest
|
||||
.spyOn(slidingSyncManager, "setRoomVisible")
|
||||
@@ -600,10 +601,7 @@ describe("RoomViewStore", function () {
|
||||
opts.buttons = buttons;
|
||||
}
|
||||
});
|
||||
|
||||
dis.dispatch({ action: Action.ViewRoom, room_id: roomId });
|
||||
await untilDispatch(Action.ViewRoom, dis);
|
||||
|
||||
await dispatchRoomLoaded();
|
||||
expect(roomViewStore.getViewRoomOpts()).toEqual({ buttons });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user