Upgrade to React Router v6 (#2919)

This commit is contained in:
Quentin Gliech
2025-01-06 18:00:20 +01:00
committed by GitHub
parent 46a82b2c39
commit b5f4a07868
19 changed files with 112 additions and 254 deletions

View File

@@ -11,8 +11,7 @@ import { type MatrixClient } from "matrix-js-sdk/src/client";
import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc";
import { of } from "rxjs";
import { JoinRule, type RoomState } from "matrix-js-sdk/src/matrix";
import { Router } from "react-router-dom";
import { createBrowserHistory } from "history";
import { BrowserRouter } from "react-router-dom";
import userEvent from "@testing-library/user-event";
import { type RelationsContainer } from "matrix-js-sdk/src/models/relations-container";
@@ -78,7 +77,6 @@ function createGroupCallView(widget: WidgetHelpers | null): {
rtcSession: MockRTCSession;
getByText: ReturnType<typeof render>["getByText"];
} {
const history = createBrowserHistory();
const client = {
getUser: () => null,
getUserId: () => localRtcMember.sender,
@@ -111,7 +109,7 @@ function createGroupCallView(widget: WidgetHelpers | null): {
video: { enabled: false },
} as MuteStates;
const { getByText } = render(
<Router history={history}>
<BrowserRouter>
<GroupCallView
client={client}
isPasswordlessUser={false}
@@ -123,7 +121,7 @@ function createGroupCallView(widget: WidgetHelpers | null): {
muteStates={muteState}
widget={widget}
/>
</Router>,
</BrowserRouter>,
);
return {
getByText,