Skip to content

Instantly share code, notes, and snippets.

@johncrisostomo
Created May 7, 2018 01:14
Show Gist options
  • Save johncrisostomo/1c96aef13927ecb51409eaa98f9bab7d to your computer and use it in GitHub Desktop.
Save johncrisostomo/1c96aef13927ecb51409eaa98f9bab7d to your computer and use it in GitHub Desktop.
it('should set SAVING_ERROR with the error message', () => {
const Meteor = {uuid: () => 'id', call: stub()};
const LocalState = {set: spy()};
const FlowRouter = {go: spy()};
const err = {message: 'Oops'};
Meteor.call.callsArgWith(4, err);
actions.create({Meteor, LocalState, FlowRouter}, 't', 'c');
expect(LocalState.set.args[1]).to.deep.equal([ 'SAVING_ERROR', err.message ]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment