Skip to content

Instantly share code, notes, and snippets.

@theKashey
Created August 16, 2018 11:49
Show Gist options
  • Select an option

  • Save theKashey/e1a67f6bddb8e079c4b0f74a7d885583 to your computer and use it in GitHub Desktop.

Select an option

Save theKashey/e1a67f6bddb8e079c4b0f74a7d885583 to your computer and use it in GitHub Desktop.
// mouse in mouse case
// solve using "naked enzyme"
wrapper = shallow(
shallow(
<div>
{shallow(<App />)
.find(Mouse)
.prop('render')({ x: 2 })}
</div>
)
.find(Mouse)
.prop('render')({ y: 4 })
);
// solved using "enzyme-extensions"
wrapper = shallow(<App />)
.find(Mouse)
.renderProp('render' ,{ x: 2 })
.find(Mouse)
.renderProp('render' ,{ y: 4 });
// solved using react-remock
remock.remock.renderProp(Mouse, { x: 2, y: 4 }); // remock could wrap only "all matching" components.
wrapper = shallow(<App />).find(Mouse).find(Mouse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment