Skip to content

Commit 7288023

Browse files
Dean OhashiDean Ohashi
authored andcommitted
altered test file
1 parent 518a0c6 commit 7288023

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

test/jest/__tests__/App.spec.js

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,39 @@ import { mount, createLocalVue, shallowMount } from '@vue/test-utils'
77
import * as All from 'quasar'
88
const { 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

Comments
 (0)