Skip to content

Instantly share code, notes, and snippets.

@johncrisostomo
Created May 7, 2018 01:13
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 johncrisostomo/59138e9b67b2f8a05f2ecaabf4e47c15 to your computer and use it in GitHub Desktop.
Save johncrisostomo/59138e9b67b2f8a05f2ecaabf4e47c15 to your computer and use it in GitHub Desktop.
it('should call Meteor.call to save the post', () => {
const Meteor = {uuid: () => 'id', call: spy()};
const LocalState = {set: spy()};
const FlowRouter = {go: spy()};
actions.create({LocalState, Meteor, FlowRouter}, 't', 'c');
const methodArgs = Meteor.call.args[0];
expect(methodArgs.slice(0, 4)).to.deep.equal([
'posts.create', 'id', 't', 'c'
]);
expect(methodArgs[4]).to.be.a('function');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment