Update test interface to add call object (#10477)

Compatibility with https://github.com/matrix-org/matrix-js-sdk/pull/3237
pull/28217/head
David Baker 2023-03-30 10:22:27 +01:00 committed by GitHub
parent 232daaff68
commit 15523cde36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -365,7 +365,7 @@ describe("LegacyCallHandler", () => {
fakeCall!.getRemoteAssertedIdentity = jest.fn().mockReturnValue({ fakeCall!.getRemoteAssertedIdentity = jest.fn().mockReturnValue({
id: NATIVE_BOB, id: NATIVE_BOB,
}); });
fakeCall!.emit(CallEvent.AssertedIdentityChanged); fakeCall!.emit(CallEvent.AssertedIdentityChanged, fakeCall);
// Now set the config option // Now set the config option
SdkConfig.add({ SdkConfig.add({
@ -378,7 +378,7 @@ describe("LegacyCallHandler", () => {
fakeCall!.getRemoteAssertedIdentity = jest.fn().mockReturnValue({ fakeCall!.getRemoteAssertedIdentity = jest.fn().mockReturnValue({
id: NATIVE_CHARLIE, id: NATIVE_CHARLIE,
}); });
fakeCall!.emit(CallEvent.AssertedIdentityChanged); fakeCall!.emit(CallEvent.AssertedIdentityChanged, fakeCall);
await roomChangePromise; await roomChangePromise;
callHandler.removeAllListeners(); callHandler.removeAllListeners();
@ -624,7 +624,7 @@ describe("LegacyCallHandler without third party protocols", () => {
// call added to call map // call added to call map
expect(callHandler.getCallForRoom(roomId)).toEqual(call); expect(callHandler.getCallForRoom(roomId)).toEqual(call);
call.emit(CallEvent.State, CallState.Ringing, CallState.Connected); call.emit(CallEvent.State, CallState.Ringing, CallState.Connected, fakeCall);
// ringer audio element started // ringer audio element started
expect(mockAudioElement.play).toHaveBeenCalled(); expect(mockAudioElement.play).toHaveBeenCalled();
@ -641,7 +641,7 @@ describe("LegacyCallHandler without third party protocols", () => {
// call added to call map // call added to call map
expect(callHandler.getCallForRoom(roomId)).toEqual(call); expect(callHandler.getCallForRoom(roomId)).toEqual(call);
call.emit(CallEvent.State, CallState.Ringing, CallState.Connected); call.emit(CallEvent.State, CallState.Ringing, CallState.Connected, fakeCall);
// ringer audio element started // ringer audio element started
expect(mockAudioElement.play).not.toHaveBeenCalled(); expect(mockAudioElement.play).not.toHaveBeenCalled();