-
Notifications
You must be signed in to change notification settings - Fork 410
Closed
Description
jest-dom
version: 1.10.0node
version: 10.5.0npm
(oryarn
) version: 6.2.0
Relevant code or config:
// downshift/src/__tests__/portal-support.js
const {getByTestId, queryByTestId} = render(
<MyPortalAutocomplete />,
)
expect(queryByTestId('menu')).not.toBeInTheDocument()
getByTestId('button').click()
expect(getByTestId('menu')).toBeInTheDocument()
What you did:
Tried replacing toBeInDOM
with any of the new suggested ways (toBeInTheDocument
/ toContainElement
)
What happened:
Both throws an error then the element is null
Reproduction:
↑ See relevant code or the Downshift repo https://github.com/paypal/downshift/blob/master/src/__tests__/portal-support.js#L57-L60
Problem description:
As far as I can tell there is no way to replace the current usage of toBeInTheDOM
with the other functions. But I might be missing something?
Suggested solution:
I think they should accept falsy (or at least null) values and just return false if that's the case
Metadata
Metadata
Assignees
Labels
No labels