mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
33 lines
785 B
JavaScript
33 lines
785 B
JavaScript
import {
|
|
generateUser,
|
|
} from '../../../../helpers/api-integration/v3';
|
|
|
|
describe('POST /user/allocate-now', () => {
|
|
// More tests in common code unit tests
|
|
|
|
it('auto allocates all points', async () => {
|
|
let user = await generateUser({
|
|
'stats.points': 5,
|
|
'stats.int': 3,
|
|
'stats.con': 9,
|
|
'stats.per': 9,
|
|
'stats.str': 9,
|
|
'preferences.allocationMode': 'flat',
|
|
});
|
|
|
|
let res = await user.post(`/user/allocate-now`);
|
|
await user.sync();
|
|
|
|
expect(res).to.eql({
|
|
data: {
|
|
stats: user.stats,
|
|
},
|
|
});
|
|
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);
|
|
});
|
|
});
|