Created
June 7, 2017 22:08
-
-
Save carlosble/285c0fede6700a6fba2eb8eee0dcd9cb to your computer and use it in GitHub Desktop.
Eventually expect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it ('populates store with data returned from server', (done) => { | |
stubApiClientToReturn({username: 'carlos'}); | |
simulateSearchFormSubmit({username: 'car'}); | |
expectStoredUsersToContainUsername('carlos', done); | |
}); | |
function expectStoredUsersToContainUsername(username, done){ | |
store.subscribe(eventuallyExpect(() => { | |
expect(store.getState().users[0].username).to.equal(username); | |
}, done)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment