Added one basic unittest for component

This commit is contained in:
Eliot Berriot 2018-04-20 18:46:18 +02:00
parent a4ce093919
commit 083b7b8e2f
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
2 changed files with 17 additions and 0 deletions

View file

@ -1,4 +1,11 @@
// helper for testing action with expected mutations
import Vue from 'vue'
export const render = (Component, propsData) => {
const Constructor = Vue.extend(Component)
return new Constructor({ propsData: propsData }).$mount()
}
export const testAction = ({action, payload, params, expectedMutations, expectedActions}, done) => {
let mutationsCount = 0
let actionsCount = 0