Files
habitica/test/api/v3/integration/user/POST-user_feed_pet_food.test.js
Feywood 7c6dd6a6bd (in)definite articles for food items. Partial fix for https://github.com/HabitRPG/habitica/issues/3571 (#9658)
* testing additional event trigger for sendMessage

* moved keyup event to newmessage

* added keyup event to tavern vue too

* all food items now have version with definite and indefinite article. foodText also adapted in messages json

* modified api.food, and feed, armoire and drop mechanism

* drops now ok, removed dropArticle, corrected feed test

* test correction

* api doc modification for task completion
2018-02-05 19:43:12 +01:00

41 lines
963 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.textThe(),
}),
});
expect(user.items.food.Milk).to.equal(1);
expect(user.items.pets['Wolf-Base']).to.equal(7);
});
});