mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-24 19:19:21 +00:00
fix test: use fetchMock to avoid test interference
This commit is contained in:
@@ -21,7 +21,6 @@ import {
|
|||||||
} from "matrix-js-sdk/lib/matrixrtc";
|
} from "matrix-js-sdk/lib/matrixrtc";
|
||||||
import { BehaviorSubject, lastValueFrom } from "rxjs";
|
import { BehaviorSubject, lastValueFrom } from "rxjs";
|
||||||
import fetchMock from "fetch-mock";
|
import fetchMock from "fetch-mock";
|
||||||
import { AutoDiscovery } from "matrix-js-sdk/lib/autodiscovery";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
mockConfig,
|
mockConfig,
|
||||||
@@ -424,21 +423,14 @@ describe("LocalTransport", () => {
|
|||||||
|
|
||||||
localTransportOpts.client.getDomain.mockReturnValue("example.org");
|
localTransportOpts.client.getDomain.mockReturnValue("example.org");
|
||||||
|
|
||||||
vi.spyOn(AutoDiscovery, "getRawClientConfig").mockImplementation(
|
fetchMock.getOnce("https://example.org/.well-known/matrix/client", {
|
||||||
async (domain) => {
|
"org.matrix.msc4143.rtc_foci": [
|
||||||
if (domain === "example.org") {
|
{
|
||||||
return Promise.resolve({
|
type: "livekit",
|
||||||
"org.matrix.msc4143.rtc_foci": [
|
livekit_service_url: "https://use-me.jwt.call.example.org",
|
||||||
{
|
},
|
||||||
type: "livekit",
|
],
|
||||||
livekit_service_url: "https://use-me.jwt.call.example.org",
|
});
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return Promise.resolve({});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
localTransportOpts.client.getAccessToken.mockReturnValue(null);
|
localTransportOpts.client.getAccessToken.mockReturnValue(null);
|
||||||
const { advertised$, active$ } =
|
const { advertised$, active$ } =
|
||||||
|
|||||||
Reference in New Issue
Block a user