mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
* Re-organize common folder * fix: Correct paths in tests * fix: move new content to proper folder * chore: Move audio folder to assets * Move sprites to sprites assets directory * Move css sprites to assets directory * Split out readmes for common code and sprites * Move images to assets directory * Move destinatin of shared browserified file * remove unused file * move compiled js to client-old * Fix karma tests * fix: Correct paths for sprites
41 lines
960 B
JavaScript
41 lines
960 B
JavaScript
/* eslint-disable camelcase */
|
|
|
|
import {
|
|
generateUser,
|
|
translate as t,
|
|
} from '../../../../helpers/api-integration/v3';
|
|
import content from '../../../../../website/common/script/content';
|
|
|
|
describe('POST /user/feed/:pet/:food', () => {
|
|
let user;
|
|
|
|
beforeEach(async () => {
|
|
user = await generateUser();
|
|
});
|
|
|
|
// More tests in common code unit tests
|
|
|
|
it('does not enjoy the food', async () => {
|
|
await user.update({
|
|
'items.pets.Wolf-Base': 5,
|
|
'items.food.Milk': 2,
|
|
});
|
|
|
|
let food = content.food.Milk;
|
|
let pet = content.petInfo['Wolf-Base'];
|
|
|
|
let res = await user.post('/user/feed/Wolf-Base/Milk');
|
|
await user.sync();
|
|
expect(res).to.eql({
|
|
data: user.items.pets['Wolf-Base'],
|
|
message: t('messageDontEnjoyFood', {
|
|
egg: pet.text(),
|
|
foodText: food.text(),
|
|
}),
|
|
});
|
|
|
|
expect(user.items.food.Milk).to.equal(1);
|
|
expect(user.items.pets['Wolf-Base']).to.equal(7);
|
|
});
|
|
});
|