From 481ea9eab9097657fe749cbb1fa09593e1b48932 Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Sun, 29 Sep 2024 01:37:09 +0530 Subject: [PATCH] WIP --- src/components/views/messages/MStickerBody.tsx | 2 +- src/components/views/rooms/MessageComposer.tsx | 2 +- .../rooms/RoomHeader/CallGuestLinkButton-test.tsx | 6 +++--- .../views/spaces/ThreadsActivityCentre-test.tsx | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/views/messages/MStickerBody.tsx b/src/components/views/messages/MStickerBody.tsx index e599dd32c7..50b7e69d40 100644 --- a/src/components/views/messages/MStickerBody.tsx +++ b/src/components/views/messages/MStickerBody.tsx @@ -61,7 +61,7 @@ export default class MStickerBody extends MImageBody { return { placement: "right", - label: content.body, + description: content.body, }; } diff --git a/src/components/views/rooms/MessageComposer.tsx b/src/components/views/rooms/MessageComposer.tsx index 99e4507c15..e1677a179e 100644 --- a/src/components/views/rooms/MessageComposer.tsx +++ b/src/components/views/rooms/MessageComposer.tsx @@ -666,7 +666,7 @@ export class MessageComposer extends React.Component { }); return ( - +
{recordingTooltip}
diff --git a/test/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx b/test/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx index 249a7893dd..044109ea92 100644 --- a/test/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx +++ b/test/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx @@ -99,7 +99,7 @@ describe("", () => { it("shows the JoinRuleDialog on click with private join rules", async () => { getComponent(room); - fireEvent.click(screen.getByLabelText("Share call link")); + fireEvent.click(screen.getByRole("button", { name: "Share call link" })); expect(modalSpy).toHaveBeenCalledWith(JoinRuleDialog, { room, canInvite: false }); // pretend public was selected jest.spyOn(room, "getJoinRule").mockReturnValue(JoinRule.Public); @@ -115,7 +115,7 @@ describe("", () => { it("shows the ShareDialog on click with public join rules", () => { jest.spyOn(room, "getJoinRule").mockReturnValue(JoinRule.Public); getComponent(room); - fireEvent.click(screen.getByLabelText("Share call link")); + fireEvent.click(screen.getByRole("button", { name: "Share call link" })); const callParams = modalSpy.mock.calls[0]; expect(callParams[0]).toEqual(ShareDialog); expect(callParams[1].target.toString()).toEqual(expectedShareDialogProps.target); @@ -127,7 +127,7 @@ describe("", () => { jest.spyOn(room, "getJoinRule").mockReturnValue(JoinRule.Knock); jest.spyOn(room, "canInvite").mockReturnValue(true); getComponent(room); - fireEvent.click(screen.getByLabelText("Share call link")); + fireEvent.click(screen.getByRole("button", { name: "Share call link" })); const callParams = modalSpy.mock.calls[0]; expect(callParams[0]).toEqual(ShareDialog); expect(callParams[1].target.toString()).toEqual(expectedShareDialogProps.target); diff --git a/test/components/views/spaces/ThreadsActivityCentre-test.tsx b/test/components/views/spaces/ThreadsActivityCentre-test.tsx index 58b8fec27a..9afa5cd852 100644 --- a/test/components/views/spaces/ThreadsActivityCentre-test.tsx +++ b/test/components/views/spaces/ThreadsActivityCentre-test.tsx @@ -29,12 +29,12 @@ describe("ThreadsActivityCentre", () => { return screen.getByRole("menu"); }; - const getTACDescription = () => { - return screen.getByText("Threads"); + const getTACDescription = (container: ReturnType["container"]) => { + return container.querySelector(".mx_ThreadsActivityCentreButton_Text"); }; const renderTAC = (props?: ComponentProps) => { - render( + return render( , @@ -130,9 +130,9 @@ describe("ThreadsActivityCentre", () => { }); it("should render the threads activity centre button and the display label", async () => { - renderTAC({ displayButtonLabel: true }); + const { container } = renderTAC({ displayButtonLabel: true }); expect(getTACButton()).toBeInTheDocument(); - expect(getTACDescription()).toBeInTheDocument(); + expect(getTACDescription(container)).toBeInTheDocument(); }); it("should render the threads activity centre menu when the button is clicked", async () => {