@@ -30,7 +30,7 @@ import { RoomViewStore } from "../../../src/stores/RoomViewStore";
30
30
import { MatrixDispatcher } from "../../../src/dispatcher/dispatcher" ;
31
31
import { SortAlgorithm } from "../../../src/stores/room-list/algorithms/models" ;
32
32
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" ;
34
34
import { LISTS_LOADING_EVENT } from "../../../src/stores/room-list/RoomListStore" ;
35
35
import { UPDATE_EVENT } from "../../../src/stores/AsyncStore" ;
36
36
@@ -92,6 +92,23 @@ describe("SlidingRoomListStore", () => {
92
92
} ) ;
93
93
} ) ;
94
94
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
+
95
112
it ( "alters 'filters.spaces' on the DefaultTagID.Untagged list if it loads with an active space" , async ( ) => {
96
113
// change the active space before we are ready
97
114
const spaceRoomId = "!foo2:bar" ;
0 commit comments