1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-07 21:23:00 +03:00

Fix typing issues

This commit is contained in:
Florian Duros
2024-04-15 15:54:37 +02:00
parent 30d60bfcdd
commit 95c0ff9da9
24 changed files with 36 additions and 121 deletions

View File

@@ -17,7 +17,6 @@ limitations under the License.
import React from "react";
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { TooltipProvider } from "@vector-im/compound-web";
import MessageTimestamp from "../../../../src/components/views/messages/MessageTimestamp";
@@ -31,7 +30,7 @@ describe("MessageTimestamp", () => {
const DAY_MS = HOUR_MS * 24;
it("should render HH:MM", () => {
const { asFragment } = render(<MessageTimestamp ts={nowDate.getTime()} />, );
const { asFragment } = render(<MessageTimestamp ts={nowDate.getTime()} />);
expect(asFragment()).toMatchInlineSnapshot(`
<DocumentFragment>
<span
@@ -47,7 +46,7 @@ describe("MessageTimestamp", () => {
});
it("should show full date & time on hover", async () => {
const { container } = render(<MessageTimestamp ts={nowDate.getTime()} />, );
const { container } = render(<MessageTimestamp ts={nowDate.getTime()} />);
await userEvent.hover(container.querySelector(".mx_MessageTimestamp")!);
expect((await screen.findByRole("tooltip")).textContent).toMatchInlineSnapshot(`"Fri, Dec 17, 2021, 08:09:00"`);
});
@@ -55,7 +54,6 @@ describe("MessageTimestamp", () => {
it("should show sent & received time on hover if passed", async () => {
const { container } = render(
<MessageTimestamp ts={nowDate.getTime()} receivedTs={nowDate.getTime() + DAY_MS} />,
,
);
await userEvent.hover(container.querySelector(".mx_MessageTimestamp")!);
expect((await screen.findByRole("tooltip")).textContent).toMatchInlineSnapshot(