Skip to content

Instantly share code, notes, and snippets.

@javierfernandes
Created November 15, 2020 15:42
Show Gist options
  • Save javierfernandes/93ed500b306d94eb7521c72eb3cf8a28 to your computer and use it in GitHub Desktop.
Save javierfernandes/93ed500b306d94eb7521c72eb3cf8a28 to your computer and use it in GitHub Desktop.
it('should add a new object for a single ADDED change', () => {
doTest({
objects: {
A: { id: 'A', name: 'A' },
B: { id: 'B', name: 'B' },
},
changes: [
{ added: { id: 'NEW', sys: 'marker', data: { children: [] }, project: 'my-project' } }
],
expectedObjects: (objects, changes) => ({
...objects, // reusing data from "objects" context
NEW: changes[0].added // reusing data from "changes" input
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment