Skip to content

Instantly share code, notes, and snippets.

@persocon
Created June 20, 2016 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save persocon/8c30534694d7d7547f607d215c2c58c8 to your computer and use it in GitHub Desktop.
Save persocon/8c30534694d7d7547f607d215c2c58c8 to your computer and use it in GitHub Desktop.
it('should fill in GET_OPTIONS when fetching all options is done', () => {
nock(apiUrl)
.get('/api/selectActivity/2/tkrp1986')
.reply(200, {options: [
{
value: "nightfall"
}
]
});
const expectedAction = {
type: 'GET_OPTIONS',
options: [
{
value: "nightfall"
}
]
};
const store = mockStore({
user: userLoggedIn
});
return store.dispatch(actions.getOptions(apiUrl)).should.eventually.equal(expectedAction);
// .then(() => {
// return expect(store.getActions()[0]).should.equal(expectedAction);
// }).should.notify(done);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment