Skip to content

Commit a5231c7

Browse files
test: add snapshot for form input
1 parent 6786046 commit a5231c7

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

test/__snapshots__/index.test.js.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ exports[`HTMLReactParser parses empty <script> 1`] = `<script />`;
110110
111111
exports[`HTMLReactParser parses empty <style> 1`] = `<style />`;
112112
113+
exports[`HTMLReactParser parses form 1`] = `
114+
<input
115+
defaultChecked={true}
116+
defaultValue="foo"
117+
type="text"
118+
/>
119+
`;
120+
113121
exports[`HTMLReactParser parses multiple HTML elements 1`] = `
114122
Array [
115123
<p>

test/data/html.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ module.exports = {
1515
doctype: '<!DOCTYPE html>',
1616
title: '<title><em>text</em></title>',
1717
customElement:
18-
'<custom-element class="myClass" custom-attribute="value" style="-o-transition: all .5s; line-height: 1;"></custom-element>'
18+
'<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">'
1920
};

test/index.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ describe('HTMLReactParser', () => {
6565
expect(parse('<style></style>')).toMatchSnapshot();
6666
});
6767

68+
it('parses form', () => {
69+
expect(parse(html.form)).toMatchSnapshot();
70+
});
71+
6872
it('parses SVG', () => {
6973
expect(parse(svg.complex)).toMatchSnapshot();
7074
});

0 commit comments

Comments
 (0)