mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-18 12:17:03 +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 />", () => {
|
describe("<SyntaxHighlight />", () => {
|
||||||
it("renders", async () => {
|
it("renders", async () => {
|
||||||
const { container } = render(<SyntaxHighlight>console.log("Hello, World!");</SyntaxHighlight>);
|
const { container } = render(
|
||||||
await waitFor(() => expect(container.querySelector(".language-arcade")).toBeTruthy());
|
<SyntaxHighlight language="javascript">console.log("Hello, World!");</SyntaxHighlight>,
|
||||||
|
);
|
||||||
|
await waitFor(() => expect(container.querySelector(".language-javascript")).toBeTruthy());
|
||||||
expect(container).toMatchSnapshot();
|
expect(container).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,17 +3,17 @@
|
|||||||
exports[`<SyntaxHighlight /> renders 1`] = `
|
exports[`<SyntaxHighlight /> renders 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<pre
|
<pre
|
||||||
class="mx_SyntaxHighlight hljs language-arcade"
|
class="mx_SyntaxHighlight hljs language-javascript"
|
||||||
>
|
>
|
||||||
<code>
|
<code>
|
||||||
<span
|
<span
|
||||||
class="hljs-built_in"
|
class="hljs-variable language_"
|
||||||
>
|
>
|
||||||
console
|
console
|
||||||
</span>
|
</span>
|
||||||
.
|
.
|
||||||
<span
|
<span
|
||||||
class="hljs-built_in"
|
class="hljs-title function_"
|
||||||
>
|
>
|
||||||
log
|
log
|
||||||
</span>
|
</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user