Fixed release pets mounts (#8545)

* Fixed release pets/mounts achievements when fully earned and added unit tests for these changes

* Fixed release pets/mounts achievements to award only when fully earned and added unit tests for these changes, also fixed linting issues

* Updated variable assignments to make more readable

* Revised releaseBoth/Pets/Mounts to include null or undefined checks, also updated unit tests

* fixed integration tests
This commit is contained in:
jerellmendoodoo
2017-07-18 16:34:54 -04:00
committed by Sabe Jones
parent ab777f7006
commit a9195f0d96
9 changed files with 199 additions and 27 deletions

View File

@@ -2,15 +2,25 @@ import {
generateUser,
translate as t,
} from '../../../../helpers/api-integration/v3';
import content from '../../../../../website/common/script/content/index';
describe('POST /user/release-mounts', () => {
let user;
let animal = 'Wolf-Base';
const loadMounts = () => {
let mounts = {};
for (let m in content.pets) {
mounts[m] = content.pets[m];
mounts[m] = true;
}
return mounts;
};
beforeEach(async () => {
user = await generateUser({
'items.currentMount': animal,
'items.mounts': {animal: true},
'items.mounts': loadMounts(),
});
});