refactor: use EnterRTCSessionOptions instead of unnamed bools

This commit is contained in:
Valere
2025-10-13 13:52:01 +02:00
parent c846ea6447
commit 8e6eb70e5b
3 changed files with 51 additions and 13 deletions

View File

@@ -15,6 +15,7 @@ import { mockConfig } from "./utils/test";
import { ElementWidgetActions, widget } from "./widget";
import { ErrorCode } from "./utils/errors.ts";
const USE_MUTI_SFU = false;
const getUrlParams = vi.hoisted(() => vi.fn(() => ({})));
vi.mock("./UrlParams", () => ({ getUrlParams }));
@@ -93,7 +94,10 @@ test("It joins the correct Session", async () => {
livekit_service_url: "http://my-well-known-service-url.com",
type: "livekit",
},
true,
{
encryptMedia: true,
useMultiSfu: USE_MUTI_SFU,
}
);
expect(mockedSession.joinRoomSession).toHaveBeenLastCalledWith(
@@ -123,12 +127,12 @@ test("It joins the correct Session", async () => {
focus_selection: "oldest_membership",
type: "livekit",
},
{
expect.objectContaining({
manageMediaKeys: false,
useLegacyMemberEvents: false,
useNewMembershipManager: true,
useExperimentalToDeviceTransport: false,
},
}),
);
});
@@ -197,7 +201,10 @@ test("It fails with configuration error if no live kit url config is set in fall
livekit_service_url: "http://my-well-known-service-url.com",
type: "livekit",
},
true,
{
encryptMedia: true,
useMultiSfu: USE_MUTI_SFU,
}
),
).rejects.toThrowError(
expect.objectContaining({ code: ErrorCode.MISSING_MATRIX_RTC_TRANSPORT }),
@@ -240,6 +247,9 @@ test("It should not fail with configuration error if homeserver config has livek
livekit_service_url: "http://my-well-known-service-url.com",
type: "livekit",
},
true,
{
encryptMedia: true,
useMultiSfu: USE_MUTI_SFU,
}
);
});