These are chat archives for airbnb/enzyme

May 2017
May 18 2017 07:33
Hello, everyone. I'm developping a project on Meteor/React, and trying to write some test on my react component with Enzyme. Component's unittest goes well so far, but how can I write a uni-test on a react's container, which depends on some Collection data?
Edwin Perez
May 18 2017 14:17
@shiningstone You can create a fake store and use mount to display the container.
const fakeStore = (state) => { default () {}, subscribe () {}, dispatch () {}, getState () { return state; }}
const store = fakeStore(fakeState);
const wrapper  = mount(
<Provider store={store}>
<Container />
Edwin Perez
May 18 2017 14:23
If you need to stub actions, you can use inject-loader if using webpack to stub those.