fix tests after moving to pnpm

This commit is contained in:
fkwp
2026-04-17 11:13:41 +02:00
parent 9c1719a22f
commit 2b42b2bdc1
7 changed files with 82 additions and 8 deletions

View File

@@ -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"

View File

@@ -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=""

View File

@@ -794,7 +794,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,
},
);

View File

@@ -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),

View File

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