Bulk stats (#9260)

* Reorganized stats

* Organized allocation common code

* Added bulk allocate to common

* Added allocate bulk route

* Fixed structure and lint

* Fixed import and apidoc
This commit is contained in:
Keith Holliday
2017-10-31 12:57:44 -06:00
committed by GitHub
parent 365daba6fc
commit 3e37941e0a
16 changed files with 342 additions and 108 deletions

View File

@@ -0,0 +1,28 @@
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(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);
});
});