Correctly fill window.matrixChat even when a Wrapper module is active (#26395)
Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
This commit is contained in:
parent
f1a39b3e4d
commit
0040181489
4 changed files with 16 additions and 6 deletions
|
@ -47,7 +47,7 @@ describe("Loading server config", function () {
|
|||
},
|
||||
},
|
||||
});
|
||||
await loadApp({});
|
||||
await loadApp({}, null);
|
||||
expect((SdkConfig.get("validated_server_config") || {}).hsUrl).toBe("https://matrix-client.matrix.org");
|
||||
});
|
||||
|
||||
|
@ -55,7 +55,7 @@ describe("Loading server config", function () {
|
|||
SdkConfig.put({
|
||||
default_server_name: "matrix.org",
|
||||
});
|
||||
await loadApp({});
|
||||
await loadApp({}, null);
|
||||
expect((SdkConfig.get("validated_server_config") || {}).hsUrl).toBe("https://matrix-client.matrix.org");
|
||||
});
|
||||
|
||||
|
@ -72,7 +72,7 @@ describe("Loading server config", function () {
|
|||
},
|
||||
},
|
||||
});
|
||||
await loadApp({});
|
||||
await loadApp({}, null);
|
||||
expect((SdkConfig.get("validated_server_config") || {}).hsUrl).toBe("https://matrix-client.matrix.org");
|
||||
},
|
||||
);
|
||||
|
|
|
@ -22,6 +22,7 @@ import fetchMock from "fetch-mock-jest";
|
|||
import { render, RenderResult, screen } from "@testing-library/react";
|
||||
import { ModuleRunner } from "matrix-react-sdk/src/modules/ModuleRunner";
|
||||
import { WrapperLifecycle, WrapperOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WrapperLifecycle";
|
||||
import MatrixChat from "matrix-react-sdk/src/components/structures/MatrixChat";
|
||||
|
||||
import WebPlatform from "../../src/vector/platform/WebPlatform";
|
||||
import { loadApp } from "../../src/vector/app";
|
||||
|
@ -68,7 +69,8 @@ describe("Wrapper", () => {
|
|||
}
|
||||
});
|
||||
|
||||
const matrixChatResult: RenderResult = render(await loadApp({}));
|
||||
const ref = React.createRef<MatrixChat>();
|
||||
const matrixChatResult: RenderResult = render(await loadApp({}, ref));
|
||||
|
||||
// at this point, we're trying to do a guest registration;
|
||||
// we expect a spinner
|
||||
|
@ -83,5 +85,8 @@ describe("Wrapper", () => {
|
|||
|
||||
expect(header.nextSibling).toBe(matrixChat);
|
||||
expect(matrixChat.nextSibling).toBe(footer);
|
||||
|
||||
// Should still hold a reference to the MatrixChat component
|
||||
expect(ref.current).toBeInstanceOf(MatrixChat);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue