Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 676c65b

Browse files
committed
More tests
1 parent 744abd9 commit 676c65b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/stores/room-list/SlidingRoomListStore-test.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { RoomViewStore } from "../../../src/stores/RoomViewStore";
3030
import { MatrixDispatcher } from "../../../src/dispatcher/dispatcher";
3131
import { SortAlgorithm } from "../../../src/stores/room-list/algorithms/models";
3232
import { DefaultTagID, TagID } from "../../../src/stores/room-list/models";
33-
import { UPDATE_SELECTED_SPACE } from "../../../src/stores/spaces";
33+
import { MetaSpace, UPDATE_SELECTED_SPACE } from "../../../src/stores/spaces";
3434
import { LISTS_LOADING_EVENT } from "../../../src/stores/room-list/RoomListStore";
3535
import { UPDATE_EVENT } from "../../../src/stores/AsyncStore";
3636

@@ -92,6 +92,23 @@ describe("SlidingRoomListStore", () => {
9292
});
9393
});
9494

95+
it("gracefully handles subspaces in the home metaspace", async () => {
96+
const subspace = "!sub:space";
97+
mocked(context._SpaceStore!.traverseSpace).mockImplementation(
98+
(spaceId: string, fn: (roomId: string) => void) => {
99+
fn(subspace);
100+
},
101+
);
102+
activeSpace = MetaSpace.Home;
103+
await store.start(); // call onReady
104+
105+
expect(context._SlidingSyncManager!.ensureListRegistered).toHaveBeenCalledWith(DefaultTagID.Untagged, {
106+
filters: expect.objectContaining({
107+
spaces: [subspace],
108+
}),
109+
});
110+
});
111+
95112
it("alters 'filters.spaces' on the DefaultTagID.Untagged list if it loads with an active space", async () => {
96113
// change the active space before we are ready
97114
const spaceRoomId = "!foo2:bar";

0 commit comments

Comments
 (0)