mirror of
https://github.com/HabitRPG/habitica.git
synced 2026-04-22 02:59:28 -05:00
Merge branch 'release' into develop
This commit is contained in:
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "habitica",
|
||||
"version": "4.92.0",
|
||||
"version": "4.92.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "habitica",
|
||||
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
|
||||
"version": "4.92.0",
|
||||
"version": "4.92.1",
|
||||
"main": "./website/server/index.js",
|
||||
"dependencies": {
|
||||
"@google-cloud/trace-agent": "^3.6.0",
|
||||
|
||||
@@ -93,6 +93,22 @@ describe('shared.ops.hatch', () => {
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
it('does not allow hatching quest pet egg using wacky potion', (done) => {
|
||||
user.items.eggs = {Bunny: 1};
|
||||
user.items.hatchingPotions = {Veggie: 1};
|
||||
user.items.pets = {};
|
||||
try {
|
||||
hatch(user, {params: {egg: 'Bunny', hatchingPotion: 'Veggie'}});
|
||||
} catch (err) {
|
||||
expect(err).to.be.an.instanceof(BadRequest);
|
||||
expect(err.message).to.equal(i18n.t('messageInvalidEggPotionCombo'));
|
||||
expect(user.items.pets).to.be.empty;
|
||||
expect(user.items.eggs).to.eql({Bunny: 1});
|
||||
expect(user.items.hatchingPotions).to.eql({Veggie: 1});
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
context('successful hatching', () => {
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = function hatch (user, req = {}) {
|
||||
throw new NotFound(i18n.t('messageMissingEggPotion', req.language));
|
||||
}
|
||||
|
||||
if (content.hatchingPotions[hatchingPotion].premium && !content.dropEggs[egg]) {
|
||||
if ((content.hatchingPotions[hatchingPotion].premium || content.hatchingPotions[hatchingPotion].wacky) && !content.dropEggs[egg]) {
|
||||
throw new BadRequest(i18n.t('messageInvalidEggPotionCombo', req.language));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user