More tests
This commit is contained in:
parent
744abd935e
commit
676c65b55c
1 changed files with 18 additions and 1 deletions
|
@ -30,7 +30,7 @@ import { RoomViewStore } from "../../../src/stores/RoomViewStore";
|
||||||
import { MatrixDispatcher } from "../../../src/dispatcher/dispatcher";
|
import { MatrixDispatcher } from "../../../src/dispatcher/dispatcher";
|
||||||
import { SortAlgorithm } from "../../../src/stores/room-list/algorithms/models";
|
import { SortAlgorithm } from "../../../src/stores/room-list/algorithms/models";
|
||||||
import { DefaultTagID, TagID } from "../../../src/stores/room-list/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 { LISTS_LOADING_EVENT } from "../../../src/stores/room-list/RoomListStore";
|
||||||
import { UPDATE_EVENT } from "../../../src/stores/AsyncStore";
|
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 () => {
|
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
|
// change the active space before we are ready
|
||||||
const spaceRoomId = "!foo2:bar";
|
const spaceRoomId = "!foo2:bar";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue