mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 12:40:00 +00:00
Added getter use
This commit is contained in:
parent
8153674dc0
commit
9725da258e
2 changed files with 7 additions and 6 deletions
|
|
@ -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,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue