Fix people space notification badge not updating for new DM invites (#10849)
* Add regression test * Fix people space notification state not updating for new DM invites
This commit is contained in:
parent
cb779fe872
commit
9611cbf6c4
2 changed files with 27 additions and 5 deletions
|
@ -672,6 +672,29 @@ describe("SpaceStore", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("should add new DM Invites to the People Space Notification State", async () => {
|
||||
mkRoom(dm1);
|
||||
mocked(client.getRoom(dm1)!).getMyMembership.mockReturnValue("join");
|
||||
mocked(client).getRoom.mockImplementation((roomId) => rooms.find((room) => room.roomId === roomId) || null);
|
||||
|
||||
await run();
|
||||
|
||||
mkRoom(dm2);
|
||||
const cliDm2 = client.getRoom(dm2)!;
|
||||
mocked(cliDm2).getMyMembership.mockReturnValue("invite");
|
||||
mocked(client).getRoom.mockImplementation((roomId) => rooms.find((room) => room.roomId === roomId) || null);
|
||||
client.emit(RoomEvent.MyMembership, cliDm2, "invite");
|
||||
|
||||
[dm1, dm2].forEach((d) => {
|
||||
expect(
|
||||
store
|
||||
.getNotificationState(MetaSpace.People)
|
||||
.rooms.map((r) => r.roomId)
|
||||
.includes(d),
|
||||
).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe("hierarchy resolution update tests", () => {
|
||||
it("updates state when spaces are joined", async () => {
|
||||
await run();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue