Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit c03122b

Browse files
test: parse code content, correct object variable
1 parent ac89cd4 commit c03122b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

utils.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,56 @@ describe("parse node to html", () => {
1010
it("should parse no language and no highlight lines (default)", () => {
1111
const html = parseNodeHtml(
1212
{
13-
text: "<code>Hello World</code>",
13+
value: "hello world",
1414
lang: "",
1515
},
1616
{}
1717
);
1818

1919
expect(html).toEqual(`<deckgo-highlight-code >
20-
<code slot="code"></code>
20+
<code slot="code">hello world</code>
2121
</deckgo-highlight-code>`);
2222
});
2323

2424
it("should parse javascript", () => {
2525
const html = parseNodeHtml(
2626
{
27-
text: "<code>Hello World</code>",
27+
value: "hello world",
2828
lang: "javascript",
2929
},
3030
{}
3131
);
3232

3333
expect(html).toEqual(`<deckgo-highlight-code language="javascript" >
34-
<code slot="code"></code>
34+
<code slot="code">hello world</code>
3535
</deckgo-highlight-code>`);
3636
});
3737

3838
it("should parse a specific language", () => {
3939
const html = parseNodeHtml(
4040
{
41-
text: "<code>Hello World</code>",
41+
value: "hello world",
4242
lang: "typescript",
4343
},
4444
{}
4545
);
4646

4747
expect(html).toEqual(`<deckgo-highlight-code language="typescript" >
48-
<code slot="code"></code>
48+
<code slot="code">hello world</code>
4949
</deckgo-highlight-code>`);
5050
});
5151

5252
it("should parse highlighted lines", () => {
5353
const html = parseNodeHtml(
5454
{
55-
text: "<code>Hello World</code>",
55+
value: "hello world",
5656
lang: "dart{3, 2, 5-9}",
5757
},
5858
{}
5959
);
6060

6161
expect(html).toEqual(`<deckgo-highlight-code language="dart" highlight-lines="3 2 5,9">
62-
<code slot="code"></code>
62+
<code slot="code">hello world</code>
6363
</deckgo-highlight-code>`);
6464
});
6565
});

0 commit comments

Comments
 (0)