Skip to content
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

Test with jest #3100

Closed
InsideGH opened this issue Aug 22, 2018 · 1 comment
Closed

Test with jest #3100

InsideGH opened this issue Aug 22, 2018 · 1 comment
Labels

Comments

@InsideGH
Copy link

Hi all,

My testcases with an open Modal breaks when I step up react-semantic from version v.0.81.3 -> v.0.82.0.

The test case:

import React from 'react'
import renderer from 'react-test-renderer'
import Success from 'app/Success'

const showProps = {
show: true,
onClose: () => {}
}

test('renders open', () => {
const component = renderer.create(<Success {...showProps}/>)
let tree = component.toJSON()
expect(tree).toMatchSnapshot()
})

The error message (from inside react-test-renderer):
TypeError: parentInstance.children.indexOf is not a function

Any tips on how to get around this or fix it is much appreciated.

Thanks Peter.

@layershifter
Copy link
Member

In 0.82.0 we begin to use React.createPortal API. The described issue known and comes from react-test-render:

reactjs/react-modal#553
mui/material-ui#9243
facebook/react#11565

As I see resolution was merged facebook/react#12895 and will be shipped with [email protected] ✌️ You can check 16.4.3-alpha.0, however I don't recomend to use it in production.

The best is wait for issue resolution I think. We have similar issue in docs, #3020 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants