Acknowledge DeviceMute widget actions (#12790)

* acknowledge DeviceMute widget actions (to prevent sending the  default error response to the widget)

* rephrase comment

* test for widget action ack
This commit is contained in:
Timo 2024-07-25 11:29:01 +02:00 committed by GitHub
parent 6e9fc55cb4
commit 72e7df0f13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 5 deletions

View file

@ -965,6 +965,18 @@ describe("ElementCall", () => {
expect(messaging.transport.send).toHaveBeenCalledWith(ElementWidgetActions.TileLayout, {});
});
it("acknowledges mute_device widget action", async () => {
await callConnectProcedure(call);
const preventDefault = jest.fn();
const mockEv = {
preventDefault,
detail: { video_enabled: false },
};
messaging.emit(`action:${ElementWidgetActions.DeviceMute}`, mockEv);
expect(messaging.transport.reply).toHaveBeenCalledWith({ video_enabled: false }, {});
expect(preventDefault).toHaveBeenCalled();
});
it("emits events when connection state changes", async () => {
// const wait = jest.spyOn(CallModule, "waitForEvent");
const onConnectionState = jest.fn();