refactor: Extract constants into constants file

This commit is contained in:
Blade Barringer
2015-12-26 19:40:36 -06:00
parent ba31cda85d
commit 1b118d86b2
4 changed files with 26 additions and 35 deletions

View File

@@ -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);
});
});