Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit c9766d5

Browse files
committed
Add mutation spec's for main store
1 parent ea1c87e commit c9766d5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/unit/specs/store/store.spec.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import store from '@/store/';
2+
import { expect } from 'chai';
3+
4+
describe.only('Store', () => {
5+
describe('mutations', () => {
6+
it('setChosenLanguageConfig', () => {
7+
const newLanguageConfig = { dir: 'test' };
8+
9+
store.commit('setChosenLanguageConfig', newLanguageConfig);
10+
11+
expect(store.state.chosenLanguageConfig.dir).to.eq('test');
12+
});
13+
14+
it('setLoggedInUser', () => {
15+
const user = { user: 'bob' };
16+
17+
store.commit('setLoggedInUser', user);
18+
19+
expect(store.state.loggedInUser.user).to.eq('bob');
20+
});
21+
22+
it('setDojo', () => {
23+
const dojo = { name: 'SuperDojo' };
24+
25+
store.commit('setDojo', dojo);
26+
27+
expect(store.state.dojo.name).to.eq('SuperDojo');
28+
});
29+
})
30+
});

0 commit comments

Comments
 (0)