Skip to content

Instantly share code, notes, and snippets.

@bmfteixeira
Created September 16, 2017 15:02
Show Gist options
  • Save bmfteixeira/383b4af1406db13ac593fe9d26ccc4ad to your computer and use it in GitHub Desktop.
Save bmfteixeira/383b4af1406db13ac593fe9d26ccc4ad to your computer and use it in GitHub Desktop.
// the mutation
[mutationTypes.MUTATION_SET_FAV_ELEM] (state, elemId) {
state.favElem = elemId
}
// the test
it('should set state.favElem', () => {
const state = {
favElem: ''
}
mutations[mutationTypes.MUTATION_SET_FAV_ELEM](state, 'AAA')
expect(state.favElem).to.equal('AAA')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment