Set language explicitly (#29332)

This commit is contained in:
David Langley
2025-02-22 00:16:33 +00:00
committed by GitHub
parent d8904a6e56
commit 0cbc6f99d0
2 changed files with 7 additions and 5 deletions
@@ -12,8 +12,10 @@ import SyntaxHighlight from "../../../../../src/components/views/elements/Syntax
describe("<SyntaxHighlight />", () => {
it("renders", async () => {
const { container } = render(<SyntaxHighlight>console.log("Hello, World!");</SyntaxHighlight>);
await waitFor(() => expect(container.querySelector(".language-arcade")).toBeTruthy());
const { container } = render(
<SyntaxHighlight language="javascript">console.log("Hello, World!");</SyntaxHighlight>,
);
await waitFor(() => expect(container.querySelector(".language-javascript")).toBeTruthy());
expect(container).toMatchSnapshot();
});