@@ -7,30 +7,39 @@ import { mount, createLocalVue, shallowMount } from '@vue/test-utils'
7
7
import * as All from 'quasar'
8
8
const { Quasar, date } = All
9
9
10
- import mutations from '../../../src/store/mutations' ;
10
+ import mutations from '../../../src/store/mutations'
11
+ import actions from '../../../src/store/actions'
11
12
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
+ } )
25
29
26
30
it ( 'deleting user action from state.userActions' , ( ) => {
27
31
mutations . DELETE_USER_ACTIONS ( state , 'action' )
28
- expect ( state . userActions . length ) . toBe ( 0 ) ;
32
+ expect ( state . userActions . length ) . toBe ( 0 )
29
33
} )
30
34
31
35
it ( 'deleting "action" from componentMap' , ( ) => {
32
- mutations . REMOVE_ACTION_FROM_COMPONENT ( state , 'action' ) ;
36
+ mutations . REMOVE_ACTION_FROM_COMPONENT ( state , 'action' )
33
37
expect ( state . componentMap . component . mapActions . length ) . toBe ( 0 )
34
38
} )
35
- } )
36
39
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