mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
v3: port hatch, equip and feed ops
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import {
|
||||
generateUser,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
|
||||
describe('POST /user/hatch/:egg/:hatchingPotion', () => {
|
||||
let user;
|
||||
|
||||
beforeEach(async () => {
|
||||
user = await generateUser();
|
||||
});
|
||||
|
||||
// More tests in common code unit tests
|
||||
|
||||
it('hatch a new pet', async () => {
|
||||
await user.update({
|
||||
'items.eggs.Wolf': 1,
|
||||
'items.hatchingPotions.Base': 1,
|
||||
});
|
||||
let res = await user.post(`/user/hatch/Wolf/Base`);
|
||||
await user.sync();
|
||||
expect(user.items.pets['Wolf-Base']).to.equal(5);
|
||||
expect(user.items.eggs.Wolf).to.equal(0);
|
||||
expect(user.items.hatchingPotions.Base).to.equal(0);
|
||||
|
||||
expect(res).to.eql({
|
||||
message: t('messageHatched'),
|
||||
data: JSON.parse(JSON.stringify(user.items)),
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user