24 lines
675 B
JavaScript
24 lines
675 B
JavaScript
import {describe, test, expect, beforeEach} from 'vitest'
|
|
import {createStore} from "vuex"
|
|
import { store as machines } from '@/store/modules/machines';
|
|
describe('machines store', () => {
|
|
const store = createStore({
|
|
modules: {
|
|
machines
|
|
}
|
|
})
|
|
|
|
beforeEach(() => {
|
|
store.dispatch('machines/resetStore')
|
|
})
|
|
|
|
test('machines should be a object', () => {
|
|
expect(typeof machines).toBe('object')
|
|
})
|
|
|
|
test('modalMachines should be a array', () => {
|
|
expect(store.getters['machines/modalMachines']).toEqual([])
|
|
store.dispatch('machines/setModalMachines', [1, 2, 3])
|
|
expect(store.getters['machines/modalMachines']).toEqual([1, 2, 3])
|
|
})
|
|
}) |