Skip to content

Instantly share code, notes, and snippets.

@ourmaninamsterdam
Created March 14, 2018 15:38
Show Gist options
  • Save ourmaninamsterdam/bfb2742bd42d8eb44f1aa6b8a561bac4 to your computer and use it in GitHub Desktop.
Save ourmaninamsterdam/bfb2742bd42d8eb44f1aa6b8a561bac4 to your computer and use it in GitHub Desktop.
Testing inner component of HOC using Enzyme
const DummyComponent = () => <div>Dummy</div>;
const Component = getComposedComponent(DummyComponent);
const component = mount(
shallow(<Component foo={true} />).get(0)
);
eventMap.resize();
expect(component.state().fooBar).toBe(true);
@ourmaninamsterdam
Copy link
Author

mount() - as we are using lifecycle methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment