Skip to content

Commit aa42b5b

Browse files
test: drop enzyme as dependency (#519)
1 parent 22bb787 commit aa42b5b

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@
6666
"@types/react-dom": "^16.0.0",
6767
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
6868
"dtslint": "^4.0.0",
69-
"enzyme": "^3.10.0",
70-
"enzyme-adapter-react-16": "^1.0.0",
7169
"eslint": "^7.0.0",
7270
"eslint-config-prettier": "^6.0.0",
7371
"eslint-config-sanity": "^4.0.0",

test/__snapshots__/react-markdown.test.js.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,6 +1389,16 @@ exports[`should be able to render inline html with self-closing tags properly wi
13891389
</p>
13901390
`;
13911391

1392+
exports[`should be able to render inline html with self-closing tags with attributes properly with HTML parser plugin (#2) 1`] = `
1393+
<p>
1394+
I am having
1395+
<wbr
1396+
className="foo"
1397+
/>
1398+
so much fun
1399+
</p>
1400+
`;
1401+
13921402
exports[`should be able to render inline html with self-closing tags with attributes properly with HTML parser plugin 1`] = `
13931403
<p>
13941404
I am having

test/react-markdown.test.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* eslint-env jest */
22
/* eslint-disable react/prop-types */
3-
const Enzyme = require('enzyme')
4-
const Adapter = require('enzyme-adapter-react-16')
53
const fs = require('fs')
64
const path = require('path')
75
const React = require('react')
@@ -16,8 +14,6 @@ const Markdown = require('../src/react-markdown')
1614
const MarkdownWithHtml = require('../src/with-html')
1715
const toc = require('remark-toc')
1816

19-
Enzyme.configure({adapter: new Adapter()})
20-
2117
const renderHTML = (input) => ReactDom.renderToStaticMarkup(input).replace(/^<div>|<\/div>$/g, '')
2218

2319
test('can render the most basic of documents (single paragraph)', () => {
@@ -314,7 +310,10 @@ test('should be able to render inline html with self-closing tags with attribute
314310

315311
test('should be able to render inline html with self-closing tags with attributes properly with HTML parser plugin (#2)', () => {
316312
const input = 'I am having <wbr class="foo"/> so much fun'
317-
Enzyme.mount(<Markdown children={input} allowDangerousHtml astPlugins={[htmlParser()]} />)
313+
const component = renderer.create(
314+
<Markdown children={input} allowDangerousHtml astPlugins={[htmlParser()]} />
315+
)
316+
expect(component.toJSON()).toMatchSnapshot()
318317
})
319318

320319
test('should be able to render multiple inline html elements with self-closing tags with attributes properly with HTML parser plugin', () => {

0 commit comments

Comments
 (0)