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

This commit is contained in:
Šimon Brandner 2022-10-07 19:31:22 +02:00 committed by GitHub
parent 6b1ee13c28
commit 4ff9681408
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View file

@ -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()!),
));
});
});