Skip to content

Instantly share code, notes, and snippets.

@georgesboris
Last active October 17, 2017 16:08
Show Gist options
  • Save georgesboris/56acad9dafc7845a8db206f5983a1ba8 to your computer and use it in GitHub Desktop.
Save georgesboris/56acad9dafc7845a8db206f5983a1ba8 to your computer and use it in GitHub Desktop.
firebase-app - tests
// first setup your mocha env as described on targaryen's docs.
// ...then:
const { paths, actions, getActionUpdates, applyAction } = require('../firebase-app');
describe('firebase-app userflow', () => {
it('should be able to update post if is author', () => {
const { updates } = getActionUpdates(updatePost, {
post: 'post_1',
value: 'My body (with adjustments)'
});
expect({ uid: 'user_1' }).can.patch(updates).path('/');
expect({ uid: 'user_2' }).cannot.patch(updates).path('/');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment