mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
* Re-organize common folder * fix: Correct paths in tests * fix: move new content to proper folder * chore: Move audio folder to assets * Move sprites to sprites assets directory * Move css sprites to assets directory * Split out readmes for common code and sprites * Move images to assets directory * Move destinatin of shared browserified file * remove unused file * move compiled js to client-old * Fix karma tests * fix: Correct paths for sprites
31 lines
748 B
JavaScript
31 lines
748 B
JavaScript
import allocateNow from '../../../website/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 [data] = 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(data).to.eql(user.stats);
|
|
});
|
|
});
|