mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-17 20:39:19 +00:00
Fix tests and lint
This commit is contained in:
@@ -125,9 +125,7 @@ describe("UrlParams", () => {
|
||||
|
||||
describe("enableClientWellKnownLookups", () => {
|
||||
it("is undefined when not set (so the config value applies)", () => {
|
||||
expect(
|
||||
computeUrlParams().enableClientWellKnownLookups,
|
||||
).toBeUndefined();
|
||||
expect(computeUrlParams().enableClientWellKnownLookups).toBeUndefined();
|
||||
});
|
||||
|
||||
it("is false when set to false", () => {
|
||||
|
||||
@@ -480,7 +480,9 @@ export const computeUrlParams = (search = "", hash = ""): UrlParams => {
|
||||
showControls: parser.getFlag("showControls"),
|
||||
hideScreensharing: parser.getFlag("hideScreensharing"),
|
||||
allowIceFallback: parser.getFlag("allowIceFallback"),
|
||||
enableClientWellKnownLookups: parser.getFlag("enableClientWellKnownLookups"),
|
||||
enableClientWellKnownLookups: parser.getFlag(
|
||||
"enableClientWellKnownLookups",
|
||||
),
|
||||
perParticipantE2EE: parser.getFlag("perParticipantE2EE"),
|
||||
controlledAudioDevices: parser.getFlag("controlledAudioDevices"),
|
||||
skipLobby: isWidget ? parser.getFlag("skipLobby") : false,
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
type CallMembership,
|
||||
type LivekitTransportConfig,
|
||||
} from "matrix-js-sdk/lib/matrixrtc";
|
||||
import { MatrixError } from "matrix-js-sdk";
|
||||
import { BehaviorSubject, filter, lastValueFrom } from "rxjs";
|
||||
import fetchMock from "fetch-mock";
|
||||
|
||||
@@ -471,6 +472,11 @@ describe("LocalTransport", () => {
|
||||
|
||||
it("supports getting transport via well-known", async () => {
|
||||
localTransportOpts.client.getDomain.mockReturnValue("example.org");
|
||||
// Pretend the server doesn't implement the transports endpoint to trigger
|
||||
// the .well-known fallback.
|
||||
localTransportOpts.client._unstable_getRTCTransports.mockRejectedValue(
|
||||
new MatrixError({ errcode: "M_UNRECOGNIZED" }, 404),
|
||||
);
|
||||
fetchMock.getOnce("https://example.org/.well-known/matrix/client", {
|
||||
"org.matrix.msc4143.rtc_foci": [
|
||||
{ type: "livekit", livekit_service_url: "https://lk.example.org" },
|
||||
@@ -501,6 +507,11 @@ describe("LocalTransport", () => {
|
||||
|
||||
it("fails fast if the openId request fails for the well-known config", async () => {
|
||||
localTransportOpts.client.getDomain.mockReturnValue("example.org");
|
||||
// Pretend the server doesn't implement the transports endpoint to trigger
|
||||
// the .well-known fallback.
|
||||
localTransportOpts.client._unstable_getRTCTransports.mockRejectedValue(
|
||||
new MatrixError({ errcode: "M_UNRECOGNIZED" }, 404),
|
||||
);
|
||||
fetchMock.getOnce("https://example.org/.well-known/matrix/client", {
|
||||
"org.matrix.msc4143.rtc_foci": [
|
||||
{ type: "livekit", livekit_service_url: "https://lk.example.org" },
|
||||
|
||||
@@ -19,6 +19,7 @@ const createRoomWidgetClientSpy = vi.mocked(createRoomWidgetClient);
|
||||
vi.mock("./config/Config", () => ({
|
||||
Config: {
|
||||
init: vi.fn().mockImplementation(async () => Promise.resolve()),
|
||||
clientWellKnownLookupsEnabled: vi.fn().mockReturnValue(true),
|
||||
},
|
||||
}));
|
||||
const configInitSpy = vi.mocked(Config.init);
|
||||
|
||||
Reference in New Issue
Block a user