From 9725da258e4d93454b74b743f9c28fa9e58f510c Mon Sep 17 00:00:00 2001 From: Keith Holliday Date: Sat, 1 Sep 2018 09:37:47 -0500 Subject: [PATCH] Added getter use --- test/client/unit/specs/components/notifications.js | 7 +++++-- website/client/components/notifications.vue | 6 ++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/client/unit/specs/components/notifications.js b/test/client/unit/specs/components/notifications.js index fe0e0bc718..9fede9de0b 100644 --- a/test/client/unit/specs/components/notifications.js +++ b/test/client/unit/specs/components/notifications.js @@ -1,11 +1,12 @@ import { shallowMount, createLocalVue } from '@vue/test-utils'; import NotificationsComponent from 'client/components/notifications.vue'; import Store from 'client/libs/store'; +import { hasClass } from 'client/store/getters/members'; const localVue = createLocalVue(); localVue.use(Store); -describe('Notifications', () => { +describe.only('Notifications', () => { let store; beforeEach(() => { @@ -29,7 +30,9 @@ describe('Notifications', () => { 'user:fetch': () => {}, 'tasks:fetchUserTasks': () => {}, }, - getters: {}, + getters: { + 'members:hasClass': hasClass, + }, }); }); diff --git a/website/client/components/notifications.vue b/website/client/components/notifications.vue index 15949ce89a..34a79452b6 100644 --- a/website/client/components/notifications.vue +++ b/website/client/components/notifications.vue @@ -200,7 +200,7 @@ export default { return !this.user.flags.classSelected && this.user.stats.lvl >= 10; }, userHasClass () { - return this.user.stats.lvl >= 10 && this.user.flags.classSelected && !this.user.preferences.disableClasses; + return this.$store.getters['members:hasClass'](this.user); }, invitedToQuest () { return this.user.party.quest.RSVPNeeded && !this.user.party.quest.completed; @@ -253,11 +253,9 @@ export default { }, userMp (after, before) { if (after === before) return; - if (!this.$store.getters['members:hasClass'](this.user)) return; + if (!this.userHasClass) return; const mana = after - before; - - if (!this.userHasClass) return; this.mp(mana); }, userLvl (after, before) {