More tests

pull/28217/head
Kegan Dougal 2023-01-20 13:27:03 +00:00
parent 744abd935e
commit 676c65b55c
1 changed files with 18 additions and 1 deletions

View File

@ -30,7 +30,7 @@ import { RoomViewStore } from "../../../src/stores/RoomViewStore";
import { MatrixDispatcher } from "../../../src/dispatcher/dispatcher";
import { SortAlgorithm } from "../../../src/stores/room-list/algorithms/models";
import { DefaultTagID, TagID } from "../../../src/stores/room-list/models";
import { UPDATE_SELECTED_SPACE } from "../../../src/stores/spaces";
import { MetaSpace, UPDATE_SELECTED_SPACE } from "../../../src/stores/spaces";
import { LISTS_LOADING_EVENT } from "../../../src/stores/room-list/RoomListStore";
import { UPDATE_EVENT } from "../../../src/stores/AsyncStore";
@ -92,6 +92,23 @@ describe("SlidingRoomListStore", () => {
});
});
it("gracefully handles subspaces in the home metaspace", async () => {
const subspace = "!sub:space";
mocked(context._SpaceStore!.traverseSpace).mockImplementation(
(spaceId: string, fn: (roomId: string) => void) => {
fn(subspace);
},
);
activeSpace = MetaSpace.Home;
await store.start(); // call onReady
expect(context._SlidingSyncManager!.ensureListRegistered).toHaveBeenCalledWith(DefaultTagID.Untagged, {
filters: expect.objectContaining({
spaces: [subspace],
}),
});
});
it("alters 'filters.spaces' on the DefaultTagID.Untagged list if it loads with an active space", async () => {
// change the active space before we are ready
const spaceRoomId = "!foo2:bar";