Snapshot issue for Fragment
See original GitHub issueTwo different snapshots are getting generated using shallow for below component
Component:
import React, { Component, Fragment } from 'react'; <Fragment> <Header location={location} matchUrl={match.url} /> <section className="ps"> <Switch> <Route path={
${matchUrl}/topics} component={TopicsContainer} /> <Route path={
${matchUrl}/people} component={PeopleContainer} /> <Route path={
${matchUrl}/tools-and-frameworks} component={ToolsAndFrameworksContainer} /> <Route path={
${matchUrl}} component={HomeContainer} /> </Switch> </section> </Fragment>
Snapshot 1:
<React.Fragment><Headerlocation={Object {"pathname": "/practices/test_9995",} } matchUrl="/practices/test_9995"/><section className="ps"><Switch><Routecomponent={[Function]}path="/practices/test_9995/topics"/><Routecomponent={[Function]}path="/practices/test_9995/people"/><Routecomponent={[Function]}path="/practices/test_9995/tools-and-frameworks"/><Routecomponent={[Function]}path="/practices/test_9995"/> </Switch></section></React.Fragment>
Snapshot 2:
<Fragment><Headerlocation={Object {"pathname": "/practices/test_9995",} } matchUrl="/practices/test_9995"/><section className="ps"><Switch><Routecomponent={[Function]}path="/practices/test_9995/topics"/><Routecomponent={[Function]}path="/practices/test_9995/people"/><Routecomponent={[Function]}path="/practices/test_9995/tools-and-frameworks"/><Routecomponent={[Function]}path="/practices/test_9995"/> </Switch></section></Fragment>
What could be the possible reason for <React.Fragment></React.Fragment> in first and <Fragment></Fragment> in latter for same component?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
@ljharb fixed after updating version of enzyme-adapter-react-16 to 1.2.0
@ljharb
“enzyme”: “3.4.1”, “enzyme-adapter-react-16”: “1.1.1”