mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-05 19:59:20 +00:00
Fix tests
This commit is contained in:
@@ -16,12 +16,15 @@ import {
|
|||||||
HeaderStyle,
|
HeaderStyle,
|
||||||
getUrlParams,
|
getUrlParams,
|
||||||
} from "../src/UrlParams";
|
} from "../src/UrlParams";
|
||||||
|
import { mockConfig } from "./utils/test";
|
||||||
|
|
||||||
const ROOM_NAME = "roomNameHere";
|
const ROOM_NAME = "roomNameHere";
|
||||||
const ROOM_ID = "!d45f138fsd";
|
const ROOM_ID = "!d45f138fsd";
|
||||||
const ORIGIN = "https://call.element.io";
|
const ORIGIN = "https://call.element.io";
|
||||||
const HOMESERVER = "localhost";
|
const HOMESERVER = "localhost";
|
||||||
|
|
||||||
|
mockConfig();
|
||||||
|
|
||||||
describe("UrlParams", () => {
|
describe("UrlParams", () => {
|
||||||
describe("handles URL with /room/", () => {
|
describe("handles URL with /room/", () => {
|
||||||
it("and nothing else", () => {
|
it("and nothing else", () => {
|
||||||
|
|||||||
@@ -439,6 +439,12 @@ export function mockConfig(
|
|||||||
const spy = vi.spyOn(Config, "get").mockReturnValue({
|
const spy = vi.spyOn(Config, "get").mockReturnValue({
|
||||||
...DEFAULT_CONFIG,
|
...DEFAULT_CONFIG,
|
||||||
...config,
|
...config,
|
||||||
|
default_server_config: {
|
||||||
|
["m.homeserver"]: {
|
||||||
|
base_url: "http://localhost:8008",
|
||||||
|
server_name: "localhost",
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
// simulate loading the config
|
// simulate loading the config
|
||||||
vi.spyOn(Config, "init").mockResolvedValue(void 0);
|
vi.spyOn(Config, "init").mockResolvedValue(void 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user