Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed May 10, 2023
1 parent 456c66d commit 7b6ff1a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/stores/SpaceStore-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7b6ff1a

Please sign in to comment.