mirror of
https://github.com/vector-im/element-call.git
synced 2026-05-01 09:54:37 +00:00
Merge pull request #3887 from element-hq/fkwp/support_latest_changes_MSC4195
Transitions Element Call from yarn to pnpm.
This commit is contained in:
@@ -17,7 +17,7 @@ exports[`InCallView > rendering > renders 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-label=""
|
||||
class="_avatar_7h2br_8 roomAvatar _avatar-imageless_7h2br_55"
|
||||
class="_avatar_va14e_8 roomAvatar _avatar-imageless_va14e_55"
|
||||
data-color="1"
|
||||
data-type="round"
|
||||
role="img"
|
||||
|
||||
@@ -204,7 +204,7 @@ exports[`DeveloperSettingsTab > renders and matches snapshot 1`] = `
|
||||
>
|
||||
<input
|
||||
aria-describedby="radix-_r_7_"
|
||||
class="_control_sqdq4_10"
|
||||
class="_control_d83jn_10"
|
||||
id="radix-_r_6_"
|
||||
name="input"
|
||||
title=""
|
||||
|
||||
@@ -802,7 +802,6 @@ export function enterRTCSession(
|
||||
makeKeyDelay: matrixRtcSessionConfig?.wait_for_key_rotation_ms,
|
||||
membershipEventExpiryMs:
|
||||
matrixRtcSessionConfig?.membership_event_expiry_ms,
|
||||
useExperimentalToDeviceTransport: true,
|
||||
unstableSendStickyEvents: matrixRTCMode === MatrixRTCMode.Matrix_2_0,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -74,7 +74,26 @@ const panNode = vi.mocked(
|
||||
* It can also be used to mock the `AudioContext` constructor in tests:
|
||||
* `vi.stubGlobal("AudioContext", () => testAudioContext);`
|
||||
*/
|
||||
export const testAudioContext = {
|
||||
export const testAudioContext: Partial<AudioContext> & {
|
||||
gain: ReturnType<
|
||||
typeof vi.mocked<{
|
||||
connect: (node: AudioNode) => AudioNode;
|
||||
gain: { setValueAtTime: ReturnType<typeof vi.fn>; value: number };
|
||||
}>
|
||||
>;
|
||||
pan: ReturnType<
|
||||
typeof vi.mocked<{
|
||||
connect: (node: AudioNode) => AudioNode;
|
||||
pan: { setValueAtTime: ReturnType<typeof vi.fn>; value: number };
|
||||
}>
|
||||
>;
|
||||
setSinkId: ReturnType<typeof vi.fn>;
|
||||
decodeAudioData: ReturnType<typeof vi.fn>;
|
||||
createBufferSource: ReturnType<typeof vi.fn>;
|
||||
createGain: ReturnType<typeof vi.fn>;
|
||||
createStereoPanner: ReturnType<typeof vi.fn>;
|
||||
close: ReturnType<typeof vi.fn>;
|
||||
} = {
|
||||
gain: gainNode,
|
||||
pan: panNode,
|
||||
setSinkId: vi.fn().mockResolvedValue(undefined),
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
vitest,
|
||||
} from "vitest";
|
||||
import {
|
||||
EventType,
|
||||
MatrixEvent,
|
||||
type Room as MatrixRoom,
|
||||
type Room,
|
||||
@@ -255,6 +256,7 @@ export function mockRtcMembership(
|
||||
const event = new MatrixEvent({
|
||||
sender: userId,
|
||||
event_id: `$-ev-${randomUUID()}:example.org`,
|
||||
type: EventType.GroupCallMemberPrefix,
|
||||
content: data,
|
||||
});
|
||||
|
||||
@@ -466,7 +468,9 @@ export class MockRTCSession extends TypedEventEmitter<
|
||||
counters: {},
|
||||
};
|
||||
|
||||
public leaveRoomSession = vitest.fn().mockResolvedValue(undefined);
|
||||
public leaveRoomSession: ReturnType<typeof vitest.fn> = vitest
|
||||
.fn()
|
||||
.mockResolvedValue(undefined);
|
||||
|
||||
public constructor(
|
||||
public readonly room: Room,
|
||||
@@ -496,7 +500,7 @@ export class MockRTCSession extends TypedEventEmitter<
|
||||
return this;
|
||||
}
|
||||
|
||||
public updateCallIntent = vitest
|
||||
public updateCallIntent: ReturnType<typeof vitest.fn> = vitest
|
||||
.fn()
|
||||
.mockImplementation(async () => Promise.resolve());
|
||||
|
||||
|
||||
@@ -51,3 +51,53 @@ window.matchMedia = global.matchMedia = (): MediaQueryList =>
|
||||
addEventListener: () => {},
|
||||
removeEventListener: () => {},
|
||||
}) as Partial<MediaQueryList> as MediaQueryList;
|
||||
|
||||
const storage: Record<string, string> = {};
|
||||
const localStoragePolyfill = {
|
||||
getItem(key: string) {
|
||||
return Object.prototype.hasOwnProperty.call(storage, key)
|
||||
? storage[key]
|
||||
: null;
|
||||
},
|
||||
setItem(key: string, value: string) {
|
||||
storage[key] = String(value);
|
||||
},
|
||||
removeItem(key: string) {
|
||||
delete storage[key];
|
||||
},
|
||||
clear() {
|
||||
for (const key in storage) {
|
||||
delete storage[key];
|
||||
}
|
||||
},
|
||||
key(index: number) {
|
||||
const keys = Object.keys(storage);
|
||||
return keys[index] ?? null;
|
||||
},
|
||||
get length() {
|
||||
return Object.keys(storage).length;
|
||||
},
|
||||
} as unknown as Storage;
|
||||
|
||||
if (
|
||||
typeof globalThis.localStorage === "undefined" ||
|
||||
typeof globalThis.localStorage.clear !== "function"
|
||||
) {
|
||||
Object.defineProperty(globalThis, "localStorage", {
|
||||
value: localStoragePolyfill,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
typeof window !== "undefined" &&
|
||||
(typeof window.localStorage === "undefined" ||
|
||||
typeof window.localStorage.clear !== "function")
|
||||
) {
|
||||
Object.defineProperty(window, "localStorage", {
|
||||
value: localStoragePolyfill,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user