Skip to content

Commit e35be8e

Browse files
test(dom-to-react): add test cases for text, comment, and doctype
1 parent 6d31abc commit e35be8e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/dom-to-react.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ const { render } = require('./helpers');
88
const { html, svg } = require('./data');
99

1010
describe('domToReact', () => {
11+
it.each([
12+
['comment', html.comment],
13+
['doctype', html.doctype]
14+
])('skips %s', (type, value) => {
15+
expect(domToReact(htmlToDOM(value))).toEqual([]);
16+
});
17+
18+
it('converts "text" to "text"', () => {
19+
const text = 'text';
20+
expect(domToReact(htmlToDOM(text))).toBe(text);
21+
});
22+
1123
it('converts single DOM node to React', () => {
1224
const reactElement = domToReact(htmlToDOM(html.single));
1325
expect(reactElement).toMatchSnapshot();

0 commit comments

Comments
 (0)