mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
refactor(client): move to Vite by @phillipthelen
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import {
|
||||
describe, expect, test, beforeEach, chai,
|
||||
} from 'vitest';
|
||||
import { shallowMount, createLocalVue } from '@vue/test-utils';
|
||||
import { toNextLevel } from '@/../../common/script/statHelpers';
|
||||
import sinon from 'sinon';
|
||||
import sinonChai from 'sinon-chai';
|
||||
import NotificationsComponent from '@/components/notifications.vue';
|
||||
import Store from '@/libs/store';
|
||||
import { hasClass } from '@/store/getters/members';
|
||||
|
||||
chai.use(sinonChai);
|
||||
|
||||
const localVue = createLocalVue();
|
||||
localVue.use(Store);
|
||||
|
||||
@@ -46,7 +53,7 @@ describe('Notifications', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('set user has class computed prop', () => {
|
||||
test('set user has class computed prop', () => {
|
||||
expect(wrapper.vm.userHasClass).to.be.false;
|
||||
|
||||
store.state.user.data.stats.lvl = 10;
|
||||
@@ -57,7 +64,7 @@ describe('Notifications', () => {
|
||||
});
|
||||
|
||||
describe('user exp notifcation', () => {
|
||||
it('notifies when user gets more exp', () => {
|
||||
test('notifies when user gets more exp', () => {
|
||||
const expSpy = sinon.spy(wrapper.vm, 'exp');
|
||||
|
||||
const userLevel = 10;
|
||||
@@ -72,7 +79,7 @@ describe('Notifications', () => {
|
||||
expSpy.restore();
|
||||
});
|
||||
|
||||
it('when user levels with exact xp', () => {
|
||||
test('when user levels with exact xp', () => {
|
||||
const expSpy = sinon.spy(wrapper.vm, 'exp');
|
||||
|
||||
const userLevelBefore = 9;
|
||||
@@ -94,7 +101,7 @@ describe('Notifications', () => {
|
||||
expSpy.restore();
|
||||
});
|
||||
|
||||
it('when user levels with exact more exp than needed', () => {
|
||||
test('when user levels with exact more exp than needed', () => {
|
||||
const expSpy = sinon.spy(wrapper.vm, 'exp');
|
||||
|
||||
const userLevelBefore = 9;
|
||||
@@ -116,7 +123,7 @@ describe('Notifications', () => {
|
||||
expSpy.restore();
|
||||
});
|
||||
|
||||
it('when user has more exp than needed then levels', () => {
|
||||
test('when user has more exp than needed then levels', () => {
|
||||
const expSpy = sinon.spy(wrapper.vm, 'exp');
|
||||
|
||||
const userLevelBefore = 9;
|
||||
@@ -138,7 +145,7 @@ describe('Notifications', () => {
|
||||
expSpy.restore();
|
||||
});
|
||||
|
||||
it('when user multilevels', () => {
|
||||
test('when user multilevels', () => {
|
||||
const expSpy = sinon.spy(wrapper.vm, 'exp');
|
||||
|
||||
const userLevelBefore = 8;
|
||||
@@ -160,7 +167,7 @@ describe('Notifications', () => {
|
||||
expSpy.restore();
|
||||
});
|
||||
|
||||
it('when user looses xp', () => {
|
||||
test('when user looses xp', () => {
|
||||
const expSpy = sinon.spy(wrapper.vm, 'exp');
|
||||
|
||||
const userLevel = 10;
|
||||
@@ -179,7 +186,7 @@ describe('Notifications', () => {
|
||||
expSpy.restore();
|
||||
});
|
||||
|
||||
it('when user looses xp under 0', () => {
|
||||
test('when user looses xp under 0', () => {
|
||||
const expSpy = sinon.spy(wrapper.vm, 'exp');
|
||||
|
||||
const userLevel = 10;
|
||||
@@ -198,7 +205,7 @@ describe('Notifications', () => {
|
||||
expSpy.restore();
|
||||
});
|
||||
|
||||
it('when user dies', () => {
|
||||
test('when user dies', () => {
|
||||
const expSpy = sinon.spy(wrapper.vm, 'exp');
|
||||
|
||||
const userLevelBefore = 10;
|
||||
|
||||
Reference in New Issue
Block a user