mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
refactor: Extract constants into constants file
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable camelcase */
|
||||
import {
|
||||
generateUser,
|
||||
} from '../helpers/common.helper';
|
||||
@@ -19,31 +18,29 @@ describe('user.fns.updateStats', () => {
|
||||
});
|
||||
|
||||
context('Stat Allocation', () => {
|
||||
it('Adds an attibute point when user\'s stat points are less than max level', () => {
|
||||
let stats = {
|
||||
exp: 3581,
|
||||
};
|
||||
|
||||
it('adds an attibute point when user\'s stat points are less than max level', () => {
|
||||
user.stats.exp = 3581;
|
||||
user.stats.lvl = 99;
|
||||
user.stats.str = 25;
|
||||
user.stats.int = 25;
|
||||
user.stats.con = 25;
|
||||
user.stats.per = 24;
|
||||
user.fns.updateStats(stats);
|
||||
|
||||
user.fns.updateStats(user.stats);
|
||||
|
||||
expect(user.stats.points).to.eql(1);
|
||||
});
|
||||
|
||||
it('Does not add an attibute point when user\'s stat points are equal to max level', () => {
|
||||
let stats = {
|
||||
exp: 3581,
|
||||
};
|
||||
|
||||
it('does not add an attibute point when user\'s stat points are equal to max level', () => {
|
||||
user.stats.exp = 3581;
|
||||
user.stats.lvl = 99;
|
||||
user.stats.str = 25;
|
||||
user.stats.int = 25;
|
||||
user.stats.con = 25;
|
||||
user.stats.per = 25;
|
||||
user.fns.updateStats(stats);
|
||||
|
||||
user.fns.updateStats(user.stats);
|
||||
|
||||
expect(user.stats.points).to.eql(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user