2024-09-02 16:28:53 +02:00
|
|
|
/*
|
2024-09-06 10:22:13 +02:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2024-09-02 16:28:53 +02:00
|
|
|
|
2025-02-18 17:59:58 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
2024-09-06 10:22:13 +02:00
|
|
|
Please see LICENSE in the repository root for full details.
|
2024-09-02 16:28:53 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { describe, expect, test } from "vitest";
|
|
|
|
|
import { render, configure } from "@testing-library/react";
|
|
|
|
|
|
|
|
|
|
import { QrCode } from "./QrCode";
|
|
|
|
|
|
|
|
|
|
configure({
|
|
|
|
|
defaultHidden: true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
describe("QrCode", () => {
|
|
|
|
|
test("renders", async () => {
|
|
|
|
|
const { container, findByRole } = render(
|
|
|
|
|
<QrCode data="foo" className="bar" />,
|
|
|
|
|
);
|
2024-09-02 16:30:37 +02:00
|
|
|
(await findByRole("img")) as HTMLImageElement;
|
2024-09-02 16:28:53 +02:00
|
|
|
expect(container.firstChild).toMatchSnapshot();
|
|
|
|
|
});
|
|
|
|
|
});
|