Refactor stores and their relationship to the MatrixClientPeg (#124)

* Refactor stores and their relationship to the MatrixClientPeg

to avoid import cycles and webpack weirdness

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-10-08 10:12:21 +01:00 committed by GitHub
parent 31bd10e887
commit 197168b3ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 71 additions and 66 deletions

View file

@ -167,7 +167,7 @@ describe("WidgetLayoutStore", () => {
it("should recalculate all rooms when the client is ready", async () => {
mocked(client.getVisibleRooms).mockReturnValue([mockRoom]);
await store.start();
await store.start(client);
expect(roomUpdateListener).toHaveBeenCalled();
expect(store.getContainerWidgets(mockRoom, Container.Top)).toEqual([]);
@ -243,7 +243,7 @@ describe("WidgetLayoutStore", () => {
});
it("should copy the layout to the room", async () => {
await store.start();
await store.start(client);
store.recalculateRoom(mockRoom);
store.moveToContainer(mockRoom, mockApps[0], Container.Top);
store.copyLayoutToRoom(mockRoom);
@ -297,7 +297,7 @@ describe("WidgetLayoutStore", () => {
mocked(client.getVisibleRooms).mockReturnValue([]);
// @ts-ignore bypass private ctor for tests
const store = new WidgetLayoutStore();
await store.start();
await store.start(client);
expect(client.getVisibleRooms).toHaveBeenCalledWith(false);
});
});
@ -314,7 +314,7 @@ describe("WidgetLayoutStore", () => {
mocked(client.getVisibleRooms).mockReturnValue([]);
// @ts-ignore bypass private ctor for tests
const store = new WidgetLayoutStore();
await store.start();
await store.start(client);
expect(client.getVisibleRooms).toHaveBeenCalledWith(true);
});
});