Last active
September 16, 2017 13:57
-
-
Save bmfteixeira/f97e85f9271c6d4dc84fb5171febd529 to your computer and use it in GitHub Desktop.
Simple Vue action test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the action | |
[actionTypes.ACTION_SET_FAV_ELEM] (context, elemId) { | |
context.commit(mutationTypes.MUTATION_SET_FAV_ELEM, elemId) | |
} | |
// the test | |
it('should invoke mutation to set the favourite element', done => { | |
const elemId = 'AAAAAA' | |
testAction(actions[actionTypes.ACTION_SET_FAV_ELEM], elemId, {}, [ | |
{ type: mutationTypes.MUTATION_SET_FAV_ELEM, payload: elemId } | |
], () => { | |
done() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment