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:
parent
31bd10e887
commit
197168b3ba
28 changed files with 71 additions and 66 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue