Skip to content

Instantly share code, notes, and snippets.

@nikfrank
Last active June 1, 2017 20:34
Show Gist options
  • Save nikfrank/615185a7cce30c3e75cc828cd8f6d69f to your computer and use it in GitHub Desktop.
Save nikfrank/615185a7cce30c3e75cc828cd8f6d69f to your computer and use it in GitHub Desktop.
React ugly async user scenario
it('can reset a TodoList', (done)=>{
// .. set up component and store ...
const unsubscribe = reduxStore.subscribe(()=>{
expect( reduxStore.getState().get('todos').size )
.toEqual( TodoList.initState.get('todos').size );
unsubscribe();
done();
});
const resetButton = mountedComponent.find('button.reset').first();
resetButton.simulate('click');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment