Closed Mayank009 closed 6 years ago
When I debugged component for both snapshots I got outputs as below.
Note: I used debug function as below
const component = shallow(<AppLayout />);
component.debug();
Snapshot 1
<Symbol(react.fragment)><Header location={{...}} matchUrl="/practices/test_9995" /><section className="ps"><Switch><Route path="/practices/test_9995/topics" component={[Function: Connect]} /><Route path="/practices/test_9995/people" component={[Function: Connect]} /><Route path="/practices/test_9995/tools-and-frameworks" component={[Function: Connect]} /><Route path="/practices/test_9995" component={[Function: Connect]} /></Switch></section></Symbol(react.fragment)>
Snapshot 2
<Fragment><Header location={{...}} matchUrl="/practices/test_9995" /><section className="ps"><Switch><Route path="/practices/test_9995/topics" component={[Function: Connect]} /><Route path="/practices/test_9995/people" component={[Function: Connect]} /><Route path="/practices/test_9995/tools-and-frameworks" component={[Function: Connect]} /><Route path="/practices/test_9995" component={[Function: Connect]} /></Switch></section></Fragment>
Any help on how can I debug reason for <Symbol(react.fragment)> in first whereas
We are facing the same problem here. However, we get different results on different test machines:
@Mayank009, what OS and npm-package versions do you run?
Just curious, could this be due to difference between those two:
@bsingr, Snapshot 1: OS: MacOS Npm Version: 6.3.0 Snapshot 2: OS: Alpine (Docker Container) Npm Version: 5.6.0.
I had this same issue. For the machine producing snapshot 1, make sure you update to the latest enzyme (v3.4.1), enzyme-to-json (v3.3.4), and enzyme-adapter-react-16 (v1.2.0). That fixed it for me. Not sure which package was causing the issue as I updated all of them at the same time. Also, not sure why my machine was out of sync with my CI server despite having a package-lock.json.
@SamSamskies it's fixed now. Thanks.
Two different snapshots are getting generated using shallow for below component
Component: `import React, { Component, Fragment } from 'react';