mirror of
https://github.com/vector-im/element-call.git
synced 2026-03-28 06:50:26 +00:00
fix tests compilation peer session timo - wip
This commit is contained in:
@@ -187,6 +187,29 @@ export const exampleTransport: LivekitTransport = {
|
||||
livekit_alias: "!alias:example.org",
|
||||
};
|
||||
|
||||
export function mockCallMembership(
|
||||
userId: string,
|
||||
deviceId: string,
|
||||
transport?: Transport,
|
||||
): CallMembership {
|
||||
const t = transport ?? transportForUser(userId);
|
||||
return {
|
||||
userId: userId,
|
||||
deviceId: deviceId,
|
||||
getTransport: vi.fn().mockReturnValue(t),
|
||||
transports: [t],
|
||||
} as unknown as CallMembership;
|
||||
}
|
||||
|
||||
function transportForUser(userId: string): Transport {
|
||||
const domain = userId.split(":")[1];
|
||||
return {
|
||||
type: "livekit",
|
||||
livekit_service_url: `https://lk.${domain}`,
|
||||
livekit_alias: `!alias:${domain}`,
|
||||
};
|
||||
}
|
||||
|
||||
export function mockRtcMembership(
|
||||
user: string | RoomMember,
|
||||
deviceId: string,
|
||||
|
||||
Reference in New Issue
Block a user