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

Commit 5b9a419

Browse files
committed
Fix lint errors
1 parent ad75b2e commit 5b9a419

File tree

5 files changed

+12
-32
lines changed

5 files changed

+12
-32
lines changed

src/store/modules/language.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import Vue from 'vue';
22

3-
const state = {
4-
chosenLanguageConfig: null,
5-
};
6-
73
export const mutations = {
84
setChosenLanguageConfig(state, chosenLanguageConfig) {
95
Vue.set(state, 'chosenLanguageConfig', chosenLanguageConfig);
@@ -14,15 +10,17 @@ export const actions = {
1410
updateChosenLanguageConfig({ commit }, chosenLanguageConfig) {
1511
commit('setChosenLanguageConfig', chosenLanguageConfig);
1612
},
17-
}
13+
};
1814

1915
export const getters = {
2016
chosenLanguageConfig: state => state.chosenLanguageConfig,
21-
}
17+
};
2218

2319
export default {
2420
namespaced: false,
25-
state,
21+
state: {
22+
chosenLanguageConfig: null,
23+
},
2624
mutations,
2725
actions,
2826
getters,

test/unit/specs/common/cd-text-direction-wrapper.spec.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import vueUnitHelper from 'vue-unit-helper';
22
import TextDirectionWrapper from '@/common/cd-text-direction-wrapper';
33

44
describe('Text Direction Wrapper', () => {
5-
65
describe('computed.textDirection', () => {
76
context('when chosen language specifies a direction', () => {
87
it('returns that value', () => {
98
const vm = vueUnitHelper(TextDirectionWrapper);
109
vm.$store = {
1110
getters: {
12-
get chosenLanguageConfig() { return { dir: 'test' }},
11+
get chosenLanguageConfig() { return { dir: 'test' }; },
1312
},
1413
};
1514
expect(vm.textDirection).to.eql('test');
@@ -21,7 +20,7 @@ describe('Text Direction Wrapper', () => {
2120
const vm = vueUnitHelper(TextDirectionWrapper);
2221
vm.$store = {
2322
getters: {
24-
get chosenLanguageConfig() { return { }},
23+
get chosenLanguageConfig() { return { }; },
2524
},
2625
};
2726
expect(vm.textDirection).to.eql('ltr');
@@ -31,10 +30,10 @@ describe('Text Direction Wrapper', () => {
3130
context('when initialised with a prop', () => {
3231
it('overrides the chosen language direction', () => {
3332
const vm = vueUnitHelper(TextDirectionWrapper);
34-
vm.direction = 'down'
33+
vm.direction = 'down';
3534
vm.$store = {
3635
getters: {
37-
get chosenLanguageConfig() { return { dir: 'test' }},
36+
get chosenLanguageConfig() { return { dir: 'test' }; },
3837
},
3938
};
4039
expect(vm.textDirection).to.eql('down');

test/unit/specs/locale/cd-lang-picker.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Lang Picker', () => {
88
let LocaleServiceMock;
99
let MomentMock;
1010
let LangPickerWithMocks;
11-
const StoreMock = new Vuex.Store()
11+
const StoreMock = new Vuex.Store();
1212

1313
beforeEach(() => {
1414
CookieMock = {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { expect } from 'chai';
33

44
describe('Language Store', () => {
55
describe('mutations', () => {
6-
const { setChosenLanguageConfig } = mutations
6+
const { setChosenLanguageConfig } = mutations;
77
it('setChosenLanguageConfig', () => {
88
const state = { chosenLanguageConfig: null };
99
const newLanguageConfig = { dir: 'test' };
@@ -16,7 +16,7 @@ describe('Language Store', () => {
1616

1717
describe('actions', () => {
1818
it('updateChosenLanguageConfig', () => {
19-
const commit = sinon.spy()
19+
const commit = sinon.spy();
2020
const state = {};
2121

2222
const chosenLanguageConfig = { dir: 'down' };

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ import { expect } from 'chai';
33

44
describe('Store', () => {
55
describe('mutations', () => {
6-
// it('setChosenLanguageConfig', () => {
7-
// console.log('store ', store);
8-
// const newLanguageConfig = { dir: 'test' };
9-
10-
// store.commit('setChosenLanguageConfig', newLanguageConfig);
11-
12-
// expect(store.state.chosenLanguageConfig.dir).to.eq('test');
13-
// });
14-
156
it('setLoggedInUser', () => {
167
const user = { user: 'bob' };
178

@@ -28,12 +19,4 @@ describe('Store', () => {
2819
expect(store.state.dojo.name).to.eq('SuperDojo');
2920
});
3021
});
31-
32-
// describe('actions', () => {
33-
// it('updateChosenLanguageConfig', () => {
34-
// console.log('actions: ', store._actions);
35-
// const commit = sinon.spy()
36-
// const state = {};
37-
// });
38-
// });
3922
});

0 commit comments

Comments
 (0)