You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow-up of #1799 (comment) after @ljharb rightfully mentioned creating a new issue.
The issue is a little confusing to me, and I'm not sure I titled it too well, so feel free to re-title it.
Current behavior
Assuming the following test:
describe('<Foobar />',()=>{test('should include Foo',()=>{constwrapper=mount(<Foobar/>);expect(wrapper.text()).toContain('Foo');});});
and the following helper component, Title:
importReactfrom'react';constTitle=({ title }: {title: string})=><span>{title}</span>;
The test fails when running against the following component:
● <Foobar /> › should include Foo
expect(string).toContain(value) // indexOf
Expected value: "Foo"
Received string: ""
What is bizarre to me is that all the following derivatives of the Foobar component (one small change at a time) pass the same test:
// ✅ Passes when `Title` is the only child of the fragmentconstFoobar=()=>(<><Titletitle="Foo"/></>);// ✅ Passes when the wrapping element is a <div> and not a <> fragmentconstFoobar=()=>(<div><Titletitle="Foo"/><>Bar</></div>);// ✅ Passes when using a <span> element instead of the <Title> componentconstFoobar=()=>(<><span>Foo</span><>Bar</></>);
Expected behavior
The failing test should pass just like the others.
Your environment
API
mount
Version
library
version
enzyme
3.9.0
react
16.8.3
react-dom
16.8.3
react-test-renderer
16.6.0
adapter (below)
1.10.0
Adapter
enzyme-adapter-react-16
The text was updated successfully, but these errors were encountered:
I can see that react-test-renderer is not a dependency of the adapter anymore, and I couldn't find anywhere mention of having to keep them in sync / having to explicitly have react-test-renderer in package.json, did I miss anything?
Now that you have fixed the issue in 8bbb61d, is the resolution to wait for a new version bump of the adapter(s), or is there anything else to do?
If you have a lockfile, you'll have to manually update the transitive dependency so that the minor versions match - or, easier, you can explicitly depend on react-test-renderer at the top, and npm/yarn will dedupe it.
8bbb61d is released in enzyme-adapter-utils v1.10.1.
This is a follow-up of #1799 (comment) after @ljharb rightfully mentioned creating a new issue.
The issue is a little confusing to me, and I'm not sure I titled it too well, so feel free to re-title it.
Current behavior
Assuming the following test:
and the following helper component,
Title
:The test fails when running against the following component:
wrapper.text()
does not contain anything:What is bizarre to me is that all the following derivatives of the
Foobar
component (one small change at a time) pass the same test:Expected behavior
The failing test should pass just like the others.
Your environment
API
Version
Adapter
The text was updated successfully, but these errors were encountered: