File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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+
13921402exports [` 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
Original file line number Diff line number Diff line change 11/* eslint-env jest */
22/* eslint-disable react/prop-types */
3- const Enzyme = require ( 'enzyme' )
4- const Adapter = require ( 'enzyme-adapter-react-16' )
53const fs = require ( 'fs' )
64const path = require ( 'path' )
75const React = require ( 'react' )
@@ -16,8 +14,6 @@ const Markdown = require('../src/react-markdown')
1614const MarkdownWithHtml = require ( '../src/with-html' )
1715const toc = require ( 'remark-toc' )
1816
19- Enzyme . configure ( { adapter : new Adapter ( ) } )
20-
2117const renderHTML = ( input ) => ReactDom . renderToStaticMarkup ( input ) . replace ( / ^ < d i v > | < \/ d i v > $ / g, '' )
2218
2319test ( '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
315311test ( '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
320319test ( 'should be able to render multiple inline html elements with self-closing tags with attributes properly with HTML parser plugin' , ( ) => {
You can’t perform that action at this time.
0 commit comments