Skip to content

test: drop enzyme as dependency #519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
"@types/react-dom": "^16.0.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"dtslint": "^4.0.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.0.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-config-sanity": "^4.0.0",
Expand Down
10 changes: 10 additions & 0 deletions test/__snapshots__/react-markdown.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,16 @@ exports[`should be able to render inline html with self-closing tags properly wi
</p>
`;

exports[`should be able to render inline html with self-closing tags with attributes properly with HTML parser plugin (#2) 1`] = `
<p>
I am having
<wbr
className="foo"
/>
so much fun
</p>
`;

exports[`should be able to render inline html with self-closing tags with attributes properly with HTML parser plugin 1`] = `
<p>
I am having
Expand Down
9 changes: 4 additions & 5 deletions test/react-markdown.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* eslint-env jest */
/* eslint-disable react/prop-types */
const Enzyme = require('enzyme')
const Adapter = require('enzyme-adapter-react-16')
const fs = require('fs')
const path = require('path')
const React = require('react')
Expand All @@ -16,8 +14,6 @@ const Markdown = require('../src/react-markdown')
const MarkdownWithHtml = require('../src/with-html')
const toc = require('remark-toc')

Enzyme.configure({adapter: new Adapter()})

const renderHTML = (input) => ReactDom.renderToStaticMarkup(input).replace(/^<div>|<\/div>$/g, '')

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

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

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