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-pets', () => {
let user;
let animal = 'Wolf-Base';
const loadPets = () => {
let pets = {};
for (let p in content.pets) {
pets[p] = content.pets[p];
pets[p] = 5;
}
return pets;
};
beforeEach(async () => {
user = await generateUser({
'items.currentPet': animal,
'items.pets': {animal: 5},
'items.pets': loadPets(),
});
});