Skip to content

Commit 8d0f7ad

Browse files
test: parse template
1 parent b518e20 commit 8d0f7ad

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

test/data/html.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ module.exports = {
1616
title: '<title><em>text</em></title>',
1717
customElement:
1818
'<custom-element class="myClass" custom-attribute="value" style="-o-transition: all .5s; line-height: 1;"></custom-element>',
19-
form: '<input type="text" value="foo" checked="checked">'
19+
form: '<input type="text" value="foo" checked="checked">',
20+
template: '<template><article><p>Test</p></article></template>'
2021
};

test/index.test.js

+12
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,18 @@ describe('HTMLReactParser', () => {
163163
`);
164164
});
165165

166+
it('parses template', () => {
167+
expect(parse(html.template)).toMatchInlineSnapshot(`
168+
<template>
169+
<article>
170+
<p>
171+
Test
172+
</p>
173+
</article>
174+
</template>
175+
`);
176+
});
177+
166178
it('parses SVG', () => {
167179
expect(parse(svg.complex)).toMatchInlineSnapshot(`
168180
<svg

0 commit comments

Comments
 (0)