mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
don’t return event data anymore for items
This commit is contained in:
@@ -35,6 +35,14 @@ describe('shops', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not return items with event data', async () => {
|
||||||
|
shopCategories.forEach(category => {
|
||||||
|
category.items.forEach(item => {
|
||||||
|
expect(item.event).to.not.exist;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('shows relevant non class gear in special category', () => {
|
it('shows relevant non class gear in special category', () => {
|
||||||
const contributor = generateUser({
|
const contributor = generateUser({
|
||||||
contributor: {
|
contributor: {
|
||||||
@@ -163,6 +171,14 @@ describe('shops', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not return items with event data', async () => {
|
||||||
|
shopCategories.forEach(category => {
|
||||||
|
category.items.forEach(item => {
|
||||||
|
expect(item.event).to.not.exist;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('timeTravelers', () => {
|
describe('timeTravelers', () => {
|
||||||
@@ -189,10 +205,19 @@ describe('shops', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not return items with event data', async () => {
|
||||||
|
shopCategories.forEach(category => {
|
||||||
|
category.items.forEach(item => {
|
||||||
|
expect(item.event).to.not.exist;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('seasonalShop', () => {
|
describe('seasonalShop', () => {
|
||||||
const shopCategories = shared.shops.getSeasonalShopCategories(user);
|
const shopCategories = shared.shops.getSeasonalShopCategories(user);
|
||||||
|
const today = new Date();
|
||||||
|
|
||||||
it('does not contain an empty category', () => {
|
it('does not contain an empty category', () => {
|
||||||
_.each(shopCategories, category => {
|
_.each(shopCategories, category => {
|
||||||
@@ -206,6 +231,14 @@ describe('shops', () => {
|
|||||||
expect(identifiers.length).to.eql(shopCategories.length);
|
expect(identifiers.length).to.eql(shopCategories.length);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not return items with event data', async () => {
|
||||||
|
shopCategories.forEach(category => {
|
||||||
|
category.items.forEach(item => {
|
||||||
|
expect(item.event).to.not.exist;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('items contain required fields', () => {
|
it('items contain required fields', () => {
|
||||||
_.each(shopCategories, category => {
|
_.each(shopCategories, category => {
|
||||||
_.each(category.items, item => {
|
_.each(category.items, item => {
|
||||||
@@ -215,5 +248,15 @@ describe('shops', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('items have a valid end date', () => {
|
||||||
|
shopCategories.forEach(category => {
|
||||||
|
category.items.forEach(item => {
|
||||||
|
expect(item.end).to.be.a('date');
|
||||||
|
expect(item.end).to.be.greaterThan(today);
|
||||||
|
console.log(item.end)
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ function getDefaultGearProps (item, language) {
|
|||||||
per: item.per,
|
per: item.per,
|
||||||
con: item.con,
|
con: item.con,
|
||||||
klass: item.klass,
|
klass: item.klass,
|
||||||
event: item.event,
|
|
||||||
set: item.set,
|
set: item.set,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -106,7 +105,6 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
|
|||||||
purchaseType: 'hatchingPotions',
|
purchaseType: 'hatchingPotions',
|
||||||
path: item.wacky ? `wackyHatchingPotions.${item.key}` : `premiumHatchingPotions.${item.key}`,
|
path: item.wacky ? `wackyHatchingPotions.${item.key}` : `premiumHatchingPotions.${item.key}`,
|
||||||
pinType: 'premiumHatchingPotion',
|
pinType: 'premiumHatchingPotion',
|
||||||
event: item.event,
|
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'food':
|
case 'food':
|
||||||
@@ -135,7 +133,6 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
|
|||||||
purchaseType: 'bundles',
|
purchaseType: 'bundles',
|
||||||
path: `bundles.${item.key}`,
|
path: `bundles.${item.key}`,
|
||||||
pinType: 'bundles',
|
pinType: 'bundles',
|
||||||
event: item.event,
|
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'quests': // eslint-disable-line no-case-declarations
|
case 'quests': // eslint-disable-line no-case-declarations
|
||||||
@@ -147,7 +144,6 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
|
|||||||
notes: item.notes(language),
|
notes: item.notes(language),
|
||||||
addlNotes: item.addlNotes ? item.addlNotes(language) : null,
|
addlNotes: item.addlNotes ? item.addlNotes(language) : null,
|
||||||
group: item.group,
|
group: item.group,
|
||||||
event: item.event,
|
|
||||||
value: item.goldValue ? item.goldValue : item.value,
|
value: item.goldValue ? item.goldValue : item.value,
|
||||||
locked,
|
locked,
|
||||||
previous: content.quests[item.previous]
|
previous: content.quests[item.previous]
|
||||||
@@ -193,7 +189,6 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
|
|||||||
class: `inventory_special_${item.key}`,
|
class: `inventory_special_${item.key}`,
|
||||||
path: `spells.special.${item.key}`,
|
path: `spells.special.${item.key}`,
|
||||||
pinType: 'seasonalSpell',
|
pinType: 'seasonalSpell',
|
||||||
event: item.event,
|
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'debuffPotion':
|
case 'debuffPotion':
|
||||||
|
|||||||
Reference in New Issue
Block a user