mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-17 11:47:02 +02:00
Set language explicitly (#29332)
This commit is contained in:
parent
d8904a6e56
commit
0cbc6f99d0
@ -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();
|
||||
});
|
||||
|
||||
|
@ -3,17 +3,17 @@
|
||||
exports[`<SyntaxHighlight /> renders 1`] = `
|
||||
<div>
|
||||
<pre
|
||||
class="mx_SyntaxHighlight hljs language-arcade"
|
||||
class="mx_SyntaxHighlight hljs language-javascript"
|
||||
>
|
||||
<code>
|
||||
<span
|
||||
class="hljs-built_in"
|
||||
class="hljs-variable language_"
|
||||
>
|
||||
console
|
||||
</span>
|
||||
.
|
||||
<span
|
||||
class="hljs-built_in"
|
||||
class="hljs-title function_"
|
||||
>
|
||||
log
|
||||
</span>
|
||||
|
Loading…
Reference in New Issue
Block a user