@@ -7,30 +7,39 @@ import { mount, createLocalVue, shallowMount } from '@vue/test-utils'
77import * as All from 'quasar'
88const { Quasar, date } = All
99
10- import mutations from '../../../src/store/mutations' ;
10+ import mutations from '../../../src/store/mutations'
11+ import actions from '../../../src/store/actions'
1112
12- describe ( 'Test mutations to remove action from component and userActions' , ( ) => {
13- const state = {
14- componentMap : {
15- component : {
16- componentName : 'App' ,
17- children : [ 'HomeView' ] ,
18- htmlList : [ ] ,
19- mapActions : [ 'action' ]
20- }
21- } ,
22- activeComponent : 'component' ,
23- userActions : [ 'action' ]
24- }
13+ describe ( 'Test mutations + actions to remove action from component and userActions' , ( ) => {
14+ let state
15+ beforeEach ( ( ) => {
16+ state = {
17+ componentMap : {
18+ component : {
19+ componentName : 'App' ,
20+ children : [ 'HomeView' ] ,
21+ htmlList : [ ] ,
22+ mapActions : [ 'action' ]
23+ }
24+ } ,
25+ activeComponent : 'component' ,
26+ userActions : [ 'action' ]
27+ }
28+ } )
2529
2630 it ( 'deleting user action from state.userActions' , ( ) => {
2731 mutations . DELETE_USER_ACTIONS ( state , 'action' )
28- expect ( state . userActions . length ) . toBe ( 0 ) ;
32+ expect ( state . userActions . length ) . toBe ( 0 )
2933 } )
3034
3135 it ( 'deleting "action" from componentMap' , ( ) => {
32- mutations . REMOVE_ACTION_FROM_COMPONENT ( state , 'action' ) ;
36+ mutations . REMOVE_ACTION_FROM_COMPONENT ( state , 'action' )
3337 expect ( state . componentMap . component . mapActions . length ) . toBe ( 0 )
3438 } )
35- } )
3639
40+ // it('deleting "action" from active component and userActions', () => {
41+ // actions.deleteUserActions('action')
42+ // expect(state.componentMap.component.mapActions.length).toBe(0)
43+ // expect(state.userActions.length).toBe(0)
44+ // })
45+ } )
0 commit comments