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
Update dependency prettier to v3 (#12095)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -43,7 +43,7 @@ describe("AutocompleteInput", () => {
|
||||
const constructMockProvider = (data: ICompletion[]) =>
|
||||
({
|
||||
getCompletions: jest.fn().mockImplementation(async () => data),
|
||||
} as unknown as AutocompleteProvider);
|
||||
}) as unknown as AutocompleteProvider;
|
||||
|
||||
beforeEach(() => {
|
||||
TestUtils.stubClient();
|
||||
|
@@ -31,7 +31,7 @@ describe("<ContextMenu />", () => {
|
||||
({
|
||||
windowWidth: windowSize,
|
||||
windowHeight: windowSize,
|
||||
} as unknown as UIStore),
|
||||
}) as unknown as UIStore,
|
||||
);
|
||||
window.Element.prototype.getBoundingClientRect = jest.fn().mockReturnValue({
|
||||
width: menuSize,
|
||||
|
@@ -480,7 +480,7 @@ describe("MessageContextMenu", () => {
|
||||
it("shows view in room button when the event is a thread root", () => {
|
||||
const eventContent = createMessageEventContent("hello");
|
||||
const mxEvent = new MatrixEvent({ type: EventType.RoomMessage, content: eventContent });
|
||||
mxEvent.getThread = () => ({ rootEvent: mxEvent } as Thread);
|
||||
mxEvent.getThread = () => ({ rootEvent: mxEvent }) as Thread;
|
||||
const props = {
|
||||
rightClick: true,
|
||||
};
|
||||
|
@@ -69,7 +69,7 @@ describe("<SpaceContextMenu />", () => {
|
||||
client: mockClient,
|
||||
getMyMembership: jest.fn(),
|
||||
...props,
|
||||
} as unknown as Room);
|
||||
}) as unknown as Room;
|
||||
|
||||
const defaultProps = {
|
||||
space: makeMockSpace(),
|
||||
|
@@ -18,7 +18,6 @@ import React from "react";
|
||||
import { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix";
|
||||
import { mocked, MockedObject } from "jest-mock";
|
||||
import { render } from "@testing-library/react";
|
||||
import * as prettier from "prettier";
|
||||
|
||||
import { getMockClientWithEventEmitter, mkEvent, mkMessage, mkStubRoom } from "../../../test-utils";
|
||||
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
|
||||
@@ -225,11 +224,7 @@ describe("<TextualBody />", () => {
|
||||
const ev = mkRoomTextMessage(`Visit https://matrix.to/#/${room1Id}/${defaultEvent.getId()}`);
|
||||
const { container } = getComponent({ mxEvent: ev });
|
||||
const content = container.querySelector(".mx_EventTile_body");
|
||||
expect(
|
||||
prettier.format(content.innerHTML.replace(defaultEvent.getId(), "%event_id%"), {
|
||||
parser: "html",
|
||||
}),
|
||||
).toMatchSnapshot();
|
||||
expect(content.innerHTML.replace(defaultEvent.getId(), "%event_id%")).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("should pillify a permalink to an unknown message in the same room with the label »Message«", () => {
|
||||
@@ -243,11 +238,7 @@ describe("<TextualBody />", () => {
|
||||
const ev = mkRoomTextMessage(`Visit https://matrix.to/#/${room2Id}/${defaultEvent.getId()}`);
|
||||
const { container } = getComponent({ mxEvent: ev });
|
||||
const content = container.querySelector(".mx_EventTile_body");
|
||||
expect(
|
||||
prettier.format(content.innerHTML.replace(defaultEvent.getId(), "%event_id%"), {
|
||||
parser: "html",
|
||||
}),
|
||||
).toMatchSnapshot();
|
||||
expect(content.innerHTML.replace(defaultEvent.getId(), "%event_id%")).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -296,71 +296,9 @@ exports[`<TextualBody /> renders formatted m.text correctly pills get injected c
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to a message in the same room with the label »Message from Member« 1`] = `
|
||||
"Visit
|
||||
<span
|
||||
><bdi
|
||||
><a
|
||||
class="mx_Pill mx_EventPill"
|
||||
href="https://matrix.to/#/!room1:example.com/%event_id%"
|
||||
data-state="closed"
|
||||
><span
|
||||
aria-label="Profile picture"
|
||||
aria-hidden="true"
|
||||
data-testid="avatar-img"
|
||||
data-type="round"
|
||||
data-color="8"
|
||||
class="_avatar_1o69u_17 mx_BaseAvatar"
|
||||
style="--cpd-avatar-size: 16px"
|
||||
><img
|
||||
loading="lazy"
|
||||
alt=""
|
||||
src="mxc://avatar.url/image.png"
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"
|
||||
class="_image_1o69u_49"
|
||||
data-type="round"
|
||||
width="16px"
|
||||
height="16px" /></span
|
||||
><span class="mx_Pill_text">Message from Member</span></a
|
||||
></bdi
|
||||
></span
|
||||
>
|
||||
"
|
||||
`;
|
||||
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to a message in the same room with the label »Message from Member« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room1:example.com/%event_id%" data-state="closed"><span aria-label="Profile picture" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="8" class="_avatar_1o69u_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/image.png" crossorigin="anonymous" referrerpolicy="no-referrer" class="_image_1o69u_49" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message from Member</span></a></bdi></span>"`;
|
||||
|
||||
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an event in another room with the label »Message in Room 2« 1`] = `
|
||||
"Visit
|
||||
<span
|
||||
><bdi
|
||||
><a
|
||||
class="mx_Pill mx_EventPill"
|
||||
href="https://matrix.to/#/!room2:example.com/%event_id%"
|
||||
data-state="closed"
|
||||
><span
|
||||
aria-label="Avatar"
|
||||
aria-hidden="true"
|
||||
data-testid="avatar-img"
|
||||
data-type="round"
|
||||
data-color="4"
|
||||
class="_avatar_1o69u_17 mx_BaseAvatar"
|
||||
style="--cpd-avatar-size: 16px"
|
||||
><img
|
||||
loading="lazy"
|
||||
alt=""
|
||||
src="mxc://avatar.url/room.png"
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"
|
||||
class="_image_1o69u_49"
|
||||
data-type="round"
|
||||
width="16px"
|
||||
height="16px" /></span
|
||||
><span class="mx_Pill_text">Message in Room 2</span></a
|
||||
></bdi
|
||||
></span
|
||||
>
|
||||
"
|
||||
`;
|
||||
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an event in another room with the label »Message in Room 2« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room2:example.com/%event_id%" data-state="closed"><span aria-label="Avatar" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="4" class="_avatar_1o69u_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/room.png" crossorigin="anonymous" referrerpolicy="no-referrer" class="_image_1o69u_49" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message in Room 2</span></a></bdi></span>"`;
|
||||
|
||||
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an unknown message in the same room with the label »Message« 1`] = `
|
||||
<span
|
||||
|
@@ -72,7 +72,7 @@ describe("<PinnedMessagesCard />", () => {
|
||||
getTimelineForEvent: () => ({
|
||||
getEvents: () => localPins,
|
||||
}),
|
||||
} as unknown as EventTimelineSet);
|
||||
}) as unknown as EventTimelineSet;
|
||||
|
||||
// Return all pins over fetchRoomEvent
|
||||
cli.fetchRoomEvent.mockImplementation((roomId, eventId) => {
|
||||
|
@@ -255,7 +255,7 @@ describe("<RoomSummaryCard />", () => {
|
||||
"@ernie:sesame.st": ["some-other-room-id", room.roomId],
|
||||
},
|
||||
}),
|
||||
}[eventType]),
|
||||
})[eventType],
|
||||
);
|
||||
getComponent();
|
||||
|
||||
|
@@ -68,7 +68,7 @@ const makeMockRoomMember = ({
|
||||
getPrevContent: jest.fn().mockReturnValue({ membership: oldMembership, ...memberContent }),
|
||||
},
|
||||
},
|
||||
} as unknown as RoomMember);
|
||||
}) as unknown as RoomMember;
|
||||
|
||||
describe("<RoomPreviewBar />", () => {
|
||||
const roomId = "RoomPreviewBar-test-room";
|
||||
|
@@ -48,7 +48,7 @@ const constructMockProvider = (data: ICompletion[]) =>
|
||||
getCompletions: jest.fn().mockImplementation(async () => data),
|
||||
getName: jest.fn().mockReturnValue("test provider"),
|
||||
renderCompletions: jest.fn().mockImplementation((components) => components),
|
||||
} as unknown as AutocompleteProvider);
|
||||
}) as unknown as AutocompleteProvider;
|
||||
|
||||
describe("WysiwygAutocomplete", () => {
|
||||
beforeAll(() => {
|
||||
|
@@ -227,7 +227,7 @@ describe("WysiwygComposer", () => {
|
||||
getCompletions: jest.fn().mockImplementation(async () => data),
|
||||
getName: jest.fn().mockReturnValue("test provider"),
|
||||
renderCompletions: jest.fn().mockImplementation((components) => components),
|
||||
} as unknown as AutocompleteProvider);
|
||||
}) as unknown as AutocompleteProvider;
|
||||
|
||||
// for each test we will insert input simulating a user mention
|
||||
const initialInput = "@abc";
|
||||
|
Reference in New Issue
Block a user