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

Close incoming Element call toast when viewing the call lobby #9375

Merged
merged 2 commits into from
Oct 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add tests
Signed-off-by: Šimon Brandner <[email protected]>
SimonBrandner committed Oct 7, 2022
commit 849e1fe0e9bc7940b1da1c70e7546e0fe54ca846
14 changes: 14 additions & 0 deletions test/toasts/IncomingCallToast-test.tsx
Original file line number Diff line number Diff line change
@@ -155,4 +155,18 @@ describe("IncomingCallEvent", () => {

defaultDispatcher.unregister(dispatcherRef);
});

it("closes toast when the call lobby is viewed", async () => {
renderToast();

defaultDispatcher.dispatch({
action: Action.ViewRoom,
room_id: room.roomId,
view_call: true,
});

await waitFor(() => expect(toastStore.dismissToast).toHaveBeenCalledWith(
getIncomingCallToastKey(call.event.getStateKey()!),
));
});
});