mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
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:
committed by
Sabe Jones
parent
ab777f7006
commit
a9195f0d96
@@ -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(),
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user