mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +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-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(),
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user