Error: `initialFocus` refers to no known node in Enzyme
See original GitHub issueI have consumed this component and it works fine. while writing test cases i m getting this error:
Error: initialFocus
refers to no known node
I actually passed a selector to initialFocus prop. I tried passing a well mounted node which already exists (tested by querying), but i m still getting the same error. Any idea why is this happening?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Developers - Error: `initialFocus` refers to no known node in Enzyme -
I have consumed this component and it works fine. while writing test cases i m getting this error: Error: initialFocus refers to no...
Read more >Why I Re-Wrote the focus-trap-react Test Suite Using React ...
The problem here is that while we're asserting that this function was called, we're really not saying anything about the actual user ...
Read more >Jest error: "Your focus-trap must have at least one container ...
I can't fix a bug in a component test. I tried to add focus on the element to the test code: await waitFor(()...
Read more >contains(nodeOrNodes) · Enzyme - GitHub Pages
contains(nodeOrNodes) => Boolean. Returns whether or not all given react elements match elements in the render tree. It will determine if an element...
Read more >Metro Ethernet Forum (MEF) - IEEE 802
Scoping the Problem ... No commitment on when/how – initial focus is “Phase I” ... Well-known addresses default to MEF-defined but are configurable!...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve found that the following mock works sufficiently for my usage within testing for the component in Jest:
I’m having this same problem, and the selector I’m passing is for a focusable element - an
<input />
. Maybe there could be an option to suppress this error from being thrown?