diff --git a/website/client/.eslintrc.js b/website/client/.eslintrc.js index cf743eba98..aecca615e0 100644 --- a/website/client/.eslintrc.js +++ b/website/client/.eslintrc.js @@ -9,11 +9,13 @@ module.exports = { rules: { 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + // TODO find a way to let eslint understand webpack aliases 'import/no-unresolved': 'off', 'vue/no-v-html': 'off', 'vue/html-self-closing': ['error', { html: { void: 'never', + // Otherwise it results in self closing span(s) and div(s) normal: 'never', component: 'always', }, diff --git a/website/client/src/components/static/clearBrowserData.vue b/website/client/src/components/static/clearBrowserData.vue index b3c30f7a50..02e6ec4314 100644 --- a/website/client/src/components/static/clearBrowserData.vue +++ b/website/client/src/components/static/clearBrowserData.vue @@ -4,7 +4,7 @@

{{ $t('clearBrowserData') }}

-
+

+ {{ $t('localStorageClear') }} +

-
+

diff --git a/website/client/tests/unit/.eslintrc.js b/website/client/tests/unit/.eslintrc.js index 2b628845dc..856287b147 100644 --- a/website/client/tests/unit/.eslintrc.js +++ b/website/client/tests/unit/.eslintrc.js @@ -1 +1,6 @@ -module.exports = require('../../../../test/.eslintrc.js'); +const base = require('../../../../test/.eslintrc.js'); + +// TODO find a way to let eslint understand webpack aliases +base.rules['import/no-unresolved'] = 'off'; + +module.exports = base; diff --git a/website/client/tests/unit/components/notifications.spec.js b/website/client/tests/unit/components/notifications.spec.js index adf33286d4..24dc2a35f6 100644 --- a/website/client/tests/unit/components/notifications.spec.js +++ b/website/client/tests/unit/components/notifications.spec.js @@ -64,7 +64,8 @@ describe('Notifications', () => { const userExpBefore = 10; const userExpAfter = 12; - wrapper.vm.displayUserExpAndLvlNotifications(userExpAfter, userExpBefore, userLevel, userLevel); + wrapper.vm + .displayUserExpAndLvlNotifications(userExpAfter, userExpBefore, userLevel, userLevel); expect(expSpy).to.be.calledWith(userExpAfter - userExpBefore); expSpy.restore(); @@ -80,7 +81,10 @@ describe('Notifications', () => { const expEarned = 5; const userExpBefore = toNextLevel(userLevelBefore) - expEarned; const userExpAfter = 0; - wrapper.vm.displayUserExpAndLvlNotifications(userExpAfter, userExpBefore, userLevelAfter, userLevelBefore); + wrapper.vm + .displayUserExpAndLvlNotifications( + userExpAfter, userExpBefore, userLevelAfter, userLevelBefore, + ); expect(expSpy).to.be.calledWith(expEarned); expSpy.restore(); @@ -97,7 +101,9 @@ describe('Notifications', () => { const expNeeded = 5; const userExpBefore = toNextLevel(userLevelBefore) - expNeeded; const userExpAfter = 5; - wrapper.vm.displayUserExpAndLvlNotifications(userExpAfter, userExpBefore, userLevelAfter, userLevelBefore); + wrapper.vm.displayUserExpAndLvlNotifications( + userExpAfter, userExpBefore, userLevelAfter, userLevelBefore, + ); expect(expSpy).to.be.calledWith(expEarned); expSpy.restore(); @@ -114,7 +120,9 @@ describe('Notifications', () => { const expNeeded = -5; const userExpBefore = toNextLevel(userLevelBefore) - expNeeded; const userExpAfter = 15; - wrapper.vm.displayUserExpAndLvlNotifications(userExpAfter, userExpBefore, userLevelAfter, userLevelBefore); + wrapper.vm.displayUserExpAndLvlNotifications( + userExpAfter, userExpBefore, userLevelAfter, userLevelBefore, + ); expect(expSpy).to.be.calledWith(expEarned); expSpy.restore(); @@ -131,7 +139,9 @@ describe('Notifications', () => { const expNeeded = 5; const userExpBefore = toNextLevel(userLevelBefore) - expNeeded; const userExpAfter = 5; - wrapper.vm.displayUserExpAndLvlNotifications(userExpAfter, userExpBefore, userLevelAfter, userLevelBefore); + wrapper.vm.displayUserExpAndLvlNotifications( + userExpAfter, userExpBefore, userLevelAfter, userLevelBefore, + ); expect(expSpy).to.be.calledWith(expEarned); expSpy.restore(); @@ -145,7 +155,9 @@ describe('Notifications', () => { const userExpBefore = 10; const userExpAfter = 5; - wrapper.vm.displayUserExpAndLvlNotifications(userExpAfter, userExpBefore, userLevel, userLevel); + wrapper.vm.displayUserExpAndLvlNotifications( + userExpAfter, userExpBefore, userLevel, userLevel, + ); expect(expSpy).to.be.calledWith(userExpAfter - userExpBefore); expSpy.restore(); @@ -159,7 +171,9 @@ describe('Notifications', () => { const userExpBefore = 5; const userExpAfter = -3; - wrapper.vm.displayUserExpAndLvlNotifications(userExpAfter, userExpBefore, userLevel, userLevel); + wrapper.vm.displayUserExpAndLvlNotifications( + userExpAfter, userExpBefore, userLevel, userLevel, + ); expect(expSpy).to.be.calledWith(userExpAfter - userExpBefore); expSpy.restore(); @@ -175,7 +189,9 @@ describe('Notifications', () => { const expEarned = -20; const userExpBefore = 20; const userExpAfter = 0; - wrapper.vm.displayUserExpAndLvlNotifications(userExpAfter, userExpBefore, userLevelAfter, userLevelBefore); + wrapper.vm.displayUserExpAndLvlNotifications( + userExpAfter, userExpBefore, userLevelAfter, userLevelBefore, + ); expect(expSpy).to.be.calledWith(expEarned); expSpy.restore(); diff --git a/website/client/tests/unit/libs/store.spec.js b/website/client/tests/unit/libs/store.spec.js index f40b59a28a..45b18a0f84 100644 --- a/website/client/tests/unit/libs/store.spec.js +++ b/website/client/tests/unit/libs/store.spec.js @@ -140,17 +140,17 @@ describe('Store', () => { data: { title: 'internal', }, + created () { + expect(this.getName('123')).to.deep.equal(['test', '123']); + expect(this.getNameRenamed('123')).to.deep.equal(['test', '123']); + done(); + }, methods: { ...mapActions(['getName']), ...mapActions({ getNameRenamed: 'getName', }), }, - created () { - expect(this.getName('123')).to.deep.equal(['test', '123']); - expect(this.getNameRenamed('123')).to.deep.equal(['test', '123']); - done(); - }, }); }); diff --git a/website/client/tests/unit/libs/store/helpers/filterTasks.spec.js b/website/client/tests/unit/libs/store/helpers/filterTasks.spec.js index 6ebafb6293..b9f86cdfc8 100644 --- a/website/client/tests/unit/libs/store/helpers/filterTasks.spec.js +++ b/website/client/tests/unit/libs/store/helpers/filterTasks.spec.js @@ -2,7 +2,7 @@ import { getTypeLabel, getFilterLabels, getActiveFilter, -} from '@/libs/store/helpers/filterTasks.js'; +} from '@/libs/store/helpers/filterTasks'; describe('Filter Category for Tasks', () => { describe('getTypeLabel', () => { diff --git a/website/client/tests/unit/libs/store/helpers/orderTasks.spec.js b/website/client/tests/unit/libs/store/helpers/orderTasks.spec.js index 1ce7876947..21c3a0f619 100644 --- a/website/client/tests/unit/libs/store/helpers/orderTasks.spec.js +++ b/website/client/tests/unit/libs/store/helpers/orderTasks.spec.js @@ -2,7 +2,7 @@ import shuffle from 'lodash/shuffle'; import { orderSingleTypeTasks, // orderMultipleTypeTasks, -} from '@/libs/store/helpers/orderTasks.js'; +} from '@/libs/store/helpers/orderTasks'; describe('Task Order Helper Function', () => {