Skip to content

Commit 95f8c40

Browse files
committed
[enzyme] [fix] render: latest cheerio can serialize innerHTML properly
Fixes #1297
1 parent 0d5ead7 commit 95f8c40

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/enzyme-test-suite/test/staticRender-spec.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,10 @@ describeWithDOM('render', () => {
142142
expect(() => render(<LazyComponent />, { suspenseFallback: false })).to.throw();
143143
});
144144
});
145+
146+
describe('can properly serialize innerHTML', () => {
147+
const wrapper = render(<span><svg dangerouslySetInnerHTML={{ __html: '<use xlink:href="#1" />' }} /></span>);
148+
149+
expect(wrapper.find('svg').html()).to.equal('<use xlink:href="#1"></use>');
150+
});
145151
});

packages/enzyme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"license": "MIT",
4040
"dependencies": {
4141
"array.prototype.flat": "^1.2.3",
42-
"cheerio": "^1.0.0-rc.3",
42+
"cheerio": "^1.0.0-rc.5",
4343
"enzyme-shallow-equal": "^1.0.4",
4444
"function.prototype.name": "^1.1.2",
4545
"has": "^1.0.3",

0 commit comments

Comments
 (0)