Files
habitica/test/common/ops/allocateNow.js
2016-03-20 20:21:15 +01:00

35 lines
783 B
JavaScript

import allocateNow from '../../../common/script/ops/allocateNow';
import {
generateUser,
} from '../../helpers/common.helper';
describe('shared.ops.allocateNow', () => {
let user;
beforeEach(() => {
user = generateUser();
});
it('auto allocates all points', () => {
user.stats.points = 5;
user.stats.int = 3;
user.stats.con = 9;
user.stats.per = 9;
user.stats.str = 9;
user.preferences.allocationMode = 'flat';
let res = allocateNow(user);
expect(user.stats.points).to.equal(0);
expect(user.stats.con).to.equal(9);
expect(user.stats.int).to.equal(8);
expect(user.stats.per).to.equal(9);
expect(user.stats.str).to.equal(9);
expect(res).to.eql({
data: {
stats: user.stats,
},
});
});
});