Created
June 21, 2016 14:23
-
-
Save persocon/edbf7cd195d9830ce178888162a4e7a2 to your computer and use it in GitHub Desktop.
This file contains 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('should fill in GET_OPTIONS when fetching all options is done', function(done) { | |
const server = sinon.fakeServer.create(); | |
server.respondWith('GET', '/api/selectActivity/2/tkrp1986',[ | |
200, | |
{ "Content-Type": "application/json" }, | |
'{options: [{value: "nightfall"}]}' | |
]); | |
const expectedAction = { | |
type: 'GET_OPTIONS', | |
options: [ | |
{ | |
value: "nightfall" | |
} | |
] | |
}; | |
const store = mockStore({ user: userLoggedIn }, expectedAction, done); | |
store.dispatch(actions.getOptions(apiUrl)) | |
.then(function() { | |
expect(store.getActions()[0]).should.equal(expectedAction); | |
done(); | |
}); | |
server.respond(); | |
server.restore(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment