You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-09 08:42:50 +03:00
Remove legacy consumers of the SDKContext in favour of HOCs
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -53,7 +53,7 @@ import { MatrixClientPeg } from "../../../src/MatrixClientPeg";
|
||||
import { Action } from "../../../src/dispatcher/actions";
|
||||
import dis, { defaultDispatcher } from "../../../src/dispatcher/dispatcher";
|
||||
import { ViewRoomPayload } from "../../../src/dispatcher/payloads/ViewRoomPayload";
|
||||
import { RoomView as _RoomView } from "../../../src/components/structures/RoomView";
|
||||
import _RoomView from "../../../src/components/structures/RoomView";
|
||||
import ResizeNotifier from "../../../src/utils/ResizeNotifier";
|
||||
import SettingsStore from "../../../src/settings/SettingsStore";
|
||||
import { SettingLevel } from "../../../src/settings/SettingLevel";
|
||||
@@ -112,7 +112,7 @@ describe("RoomView", () => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
const mountRoomView = async (ref?: RefObject<_RoomView>): Promise<RenderResult> => {
|
||||
const mountRoomView = async (ref?: RefObject<React.ComponentRef<typeof _RoomView>>): Promise<RenderResult> => {
|
||||
if (stores.roomViewStore.getRoomId() !== room.roomId) {
|
||||
const switchedRoom = new Promise<void>((resolve) => {
|
||||
const subFn = () => {
|
||||
@@ -185,8 +185,8 @@ describe("RoomView", () => {
|
||||
await flushPromises();
|
||||
return roomView;
|
||||
};
|
||||
const getRoomViewInstance = async (): Promise<_RoomView> => {
|
||||
const ref = createRef<_RoomView>();
|
||||
const getRoomViewInstance = async (): Promise<React.ComponentRef<typeof _RoomView>> => {
|
||||
const ref = createRef<React.ComponentRef<typeof _RoomView>>();
|
||||
await mountRoomView(ref);
|
||||
return ref.current!;
|
||||
};
|
||||
@@ -197,7 +197,7 @@ describe("RoomView", () => {
|
||||
});
|
||||
|
||||
describe("when there is an old room", () => {
|
||||
let instance: _RoomView;
|
||||
let instance: React.ComponentRef<typeof _RoomView>;
|
||||
let oldRoom: Room;
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -596,7 +596,7 @@ describe("RoomView", () => {
|
||||
|
||||
const eventMapper = (obj: Partial<IEvent>) => new MatrixEvent(obj);
|
||||
|
||||
const roomViewRef = createRef<_RoomView>();
|
||||
const roomViewRef = createRef<React.ComponentRef<typeof _RoomView>>();
|
||||
const { container, getByText, findByLabelText } = await mountRoomView(roomViewRef);
|
||||
// @ts-ignore - triggering a search organically is a lot of work
|
||||
roomViewRef.current!.setState({
|
||||
@@ -657,7 +657,7 @@ describe("RoomView", () => {
|
||||
|
||||
const eventMapper = (obj: Partial<IEvent>) => new MatrixEvent(obj);
|
||||
|
||||
const roomViewRef = createRef<_RoomView>();
|
||||
const roomViewRef = createRef<React.ComponentRef<typeof _RoomView>>();
|
||||
const { container, getByText, findByLabelText } = await mountRoomView(roomViewRef);
|
||||
// @ts-ignore - triggering a search organically is a lot of work
|
||||
roomViewRef.current!.setState({
|
||||
|
@@ -59,7 +59,7 @@ describe("MemberList", () => {
|
||||
let client: MatrixClient;
|
||||
let root: RenderResult;
|
||||
let memberListRoom: Room;
|
||||
let memberList: MemberList;
|
||||
let memberList: React.ComponentRef<typeof MemberList>;
|
||||
|
||||
let adminUsers: RoomMember[] = [];
|
||||
let moderatorUsers: RoomMember[] = [];
|
||||
@@ -214,7 +214,7 @@ describe("MemberList", () => {
|
||||
memberListRoom.currentState.members[member.userId] = member;
|
||||
}
|
||||
|
||||
const gatherWrappedRef = (r: MemberList) => {
|
||||
const gatherWrappedRef = (r: React.ComponentRef<typeof MemberList>) => {
|
||||
memberList = r;
|
||||
};
|
||||
const context = new TestSdkContext();
|
||||
|
Reference in New Issue
Block a user