1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-30 02:21:17 +03:00

Prefer MatrixClientContext over MatrixClientPeg (#10986)

This commit is contained in:
Michael Telatynski
2023-06-14 13:42:07 +01:00
committed by GitHub
parent b40f29f04c
commit 9c48487d85
20 changed files with 120 additions and 87 deletions

View File

@ -17,7 +17,7 @@ limitations under the License.
import React from "react";
import { act, render, RenderResult } from "@testing-library/react";
import { filterConsole, stubClient } from "../../../test-utils";
import { filterConsole, withClientContextRenderOptions, stubClient } from "../../../test-utils";
import { UserOnboardingPage } from "../../../../src/components/views/user-onboarding/UserOnboardingPage";
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
import SdkConfig from "../../../../src/SdkConfig";
@ -34,7 +34,7 @@ jest.mock("../../../../src/components/structures/HomePage", () => ({
describe("UserOnboardingPage", () => {
const renderComponent = async (): Promise<RenderResult> => {
const renderResult = render(<UserOnboardingPage />);
const renderResult = render(<UserOnboardingPage />, withClientContextRenderOptions(MatrixClientPeg.safeGet()));
await act(async () => {
jest.runAllTimers();
});