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
After upgrading from 5.2.1 to 5.2.2, className props applied to inner nodes using a spread are being applied to outer nodes as well.
For example:
importReactfrom'react';importSliderfrom'react-slick';importstylesfrom'./styles.scss';constTest=()=>{constsettings={className: styles.innerSlider};return(<divstyleName="vehicleSlider">
foo
<Slider{...settings}>
bar
</Slider></div>);};exportdefaultTest;
Test:
importReactfrom'react';import{shallow}from'enzyme';importtoJsonfrom'enzyme-to-json';importTestfrom'.';describe('<Test />',()=>{it('matches its snapshot',()=>{constwrapper=shallow(<Test/>);expect(toJson(wrapper)).toMatchSnapshot();});});
Which generates the snapshot:
// Jest Snapshot v1, https://goo.gl/fbAQLPexports[`<Test /> matches its snapshot 1`]=`<div className="vehicleSlider innerSlider"> foo <Slider className="innerSlider" > bar </Slider></div>`;
The outer div should only have a className of vehicleSlider.
With 5.2.1, the snapshot is instead
// Jest Snapshot v1, https://goo.gl/fbAQLPexports[`<Test /> matches its snapshot 1`]=`<div className="vehicleSlider"> foo <Slider className="innerSlider" > bar </Slider></div>`;
Which is what is expected.
The text was updated successfully, but these errors were encountered:
After upgrading from 5.2.1 to 5.2.2, className props applied to inner nodes using a spread are being applied to outer nodes as well.
For example:
Test:
Which generates the snapshot:
The outer div should only have a className of
vehicleSlider
.With 5.2.1, the snapshot is instead
Which is what is expected.
The text was updated successfully, but these errors were encountered: