mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Fix: if wrapping
This commit is contained in:
@@ -13,23 +13,21 @@ describe('getDebuffPotionItems', () => {
|
|||||||
user = generateUser();
|
user = generateUser();
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const key in TRANSFORMATION_DEBUFFS_LIST) {
|
for (const key of Object.keys(TRANSFORMATION_DEBUFFS_LIST)) {
|
||||||
if (Object.prototype.hasOwnProperty.call(TRANSFORMATION_DEBUFFS_LIST, key)) {
|
const debuff = TRANSFORMATION_DEBUFFS_LIST[key];
|
||||||
const debuff = TRANSFORMATION_DEBUFFS_LIST[key];
|
// Here we itterate whole object to dynamicaly create test suites as
|
||||||
// Here we itterate whole object to dynamicaly create test suites as
|
// it described in dock of mocha
|
||||||
// it described in dock of mocha
|
// https://mochajs.org/#dynamically-generating-tests
|
||||||
// https://mochajs.org/#dynamically-generating-tests
|
// That's why we have eslint-disable here
|
||||||
// That's why we have eslint-disable here
|
// eslint-disable-next-line no-loop-func
|
||||||
// eslint-disable-next-line no-loop-func
|
it(`Should return the ${debuff} on ${key} buff`, () => {
|
||||||
it(`Should return the ${debuff} on ${key} buff`, () => {
|
user.stats.buffs[key] = true;
|
||||||
user.stats.buffs[key] = true;
|
|
||||||
|
|
||||||
const result = getDebuffPotionItems(user);
|
const result = getDebuffPotionItems(user);
|
||||||
|
|
||||||
expect(result).to.be.an('array').that.deep
|
expect(result).to.be.an('array').that.deep
|
||||||
.includes({ path: `spells.special.${debuff}`, type: 'debuffPotion' });
|
.includes({ path: `spells.special.${debuff}`, type: 'debuffPotion' });
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it('Should return all debuff potions for all buffs', () => {
|
it('Should return all debuff potions for all buffs', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user