Align common_* strings with Element X project in Localazy (#11434)

This commit is contained in:
Michael Telatynski 2023-08-22 18:47:33 +01:00 committed by GitHub
parent 1a49a38f04
commit c40141cc4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
132 changed files with 1491 additions and 1247 deletions

View file

@ -22,6 +22,7 @@ import encrypt from "matrix-encrypt-attachment";
import { mocked } from "jest-mock";
import fs from "fs";
import path from "path";
import userEvent from "@testing-library/user-event";
import MImageBody from "../../../../src/components/views/messages/MImageBody";
import { RoomPermalinkCreator } from "../../../../src/utils/permalinks/Permalinks";
@ -258,4 +259,29 @@ describe("<MImageBody/>", () => {
// thumbnail with dimensions present
expect(container).toMatchSnapshot();
});
it("should show banner on hover", async () => {
const event = new MatrixEvent({
room_id: "!room:server",
sender: userId,
type: EventType.RoomMessage,
content: {
body: "alt for a test image",
info: {
w: 40,
h: 50,
},
url: "mxc://server/image",
},
});
const { container } = render(
<MImageBody {...props} mxEvent={event} mediaEventHelper={new MediaEventHelper(event)} />,
);
const img = container.querySelector(".mx_MImageBody_thumbnail")!;
await userEvent.hover(img);
expect(container.querySelector(".mx_MImageBody_banner")).toHaveTextContent("...alt for a test image");
});
});