element-call-Github/src/Header.test.tsx

31 lines
830 B
TypeScript
Raw Normal View History

2024-09-06 04:23:44 +08:00
/*
Copyright 2024 New Vector Ltd.
2024-09-06 04:23:44 +08:00
SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
2024-09-06 04:23:44 +08:00
*/
2024-09-07 01:15:34 +08:00
import { expect, test } from "vitest";
2024-09-06 04:23:44 +08:00
import { render, screen } from "@testing-library/react";
import { axe } from "vitest-axe";
import { TooltipProvider } from "@vector-im/compound-web";
import { RoomHeaderInfo } from "./Header";
test("RoomHeaderInfo is accessible", async () => {
const { container } = render(
<TooltipProvider>
<RoomHeaderInfo
id="!a:example.org"
name="Mission Control"
avatarUrl=""
encrypted
participantCount={11}
/>
</TooltipProvider>,
);
expect(await axe(container)).toHaveNoViolations();
// Check that the room name acts as a heading
screen.getByRole("heading", { name: "Mission Control" });
});