mirror of https://github.com/vector-im/riot-web
Test and fix subspace invite receipt behaviour
parent
dd2a1d063a
commit
f85d3643ee
|
@ -203,7 +203,8 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
|||
}
|
||||
|
||||
public getChildSpaces(spaceId: string): Room[] {
|
||||
return this.getChildren(spaceId).filter(r => r.isSpaceRoom());
|
||||
// don't show invited subspaces as they surface at the top level for better visibility
|
||||
return this.getChildren(spaceId).filter(r => r.isSpaceRoom() && r.getMyMembership() === "join");
|
||||
}
|
||||
|
||||
public getParents(roomId: string, canonicalOnly = false): Room[] {
|
||||
|
|
|
@ -288,6 +288,17 @@ describe("SpaceStore", () => {
|
|||
expect(store.getChildSpaces("!d:server")).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("invite to a subspace is only shown at the top level", async () => {
|
||||
mkSpace(invite1).getMyMembership.mockReturnValue("invite");
|
||||
mkSpace(space1, [invite1]);
|
||||
await run();
|
||||
|
||||
expect(store.spacePanelSpaces).toStrictEqual([client.getRoom(space1)]);
|
||||
expect(store.getChildSpaces(space1)).toStrictEqual([]);
|
||||
expect(store.getChildRooms(space1)).toStrictEqual([]);
|
||||
expect(store.invitedSpaces).toStrictEqual([client.getRoom(invite1)]);
|
||||
});
|
||||
|
||||
describe("test fixture 1", () => {
|
||||
beforeEach(async () => {
|
||||
[fav1, fav2, fav3, dm1, dm2, dm3, orphan1, orphan2, invite1, invite2, room1].forEach(mkRoom);
|
||||
|
|
Loading…
Reference in New Issue