From a73abcca744700997533e94e3d3ec23b3679d6ff Mon Sep 17 00:00:00 2001 From: Phillip Thelen Date: Thu, 9 May 2024 13:55:24 +0200 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20return=20event=20data=20anymore?= =?UTF-8?q?=20for=20items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/common/libs/shops.js | 43 +++++++++++++++++++++++ website/common/script/libs/getItemInfo.js | 5 --- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/test/common/libs/shops.js b/test/common/libs/shops.js index 54ed48dc54..9d94ab2cc1 100644 --- a/test/common/libs/shops.js +++ b/test/common/libs/shops.js @@ -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', () => { const contributor = generateUser({ 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', () => { @@ -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', () => { const shopCategories = shared.shops.getSeasonalShopCategories(user); + const today = new Date(); it('does not contain an empty category', () => { _.each(shopCategories, category => { @@ -206,6 +231,14 @@ describe('shops', () => { 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', () => { _.each(shopCategories, category => { _.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) + }); + }); + }); }); }); diff --git a/website/common/script/libs/getItemInfo.js b/website/common/script/libs/getItemInfo.js index a5f659cf64..429831d28b 100644 --- a/website/common/script/libs/getItemInfo.js +++ b/website/common/script/libs/getItemInfo.js @@ -53,7 +53,6 @@ function getDefaultGearProps (item, language) { per: item.per, con: item.con, klass: item.klass, - event: item.event, set: item.set, }; } @@ -106,7 +105,6 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang purchaseType: 'hatchingPotions', path: item.wacky ? `wackyHatchingPotions.${item.key}` : `premiumHatchingPotions.${item.key}`, pinType: 'premiumHatchingPotion', - event: item.event, }; break; case 'food': @@ -135,7 +133,6 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang purchaseType: 'bundles', path: `bundles.${item.key}`, pinType: 'bundles', - event: item.event, }; break; 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), addlNotes: item.addlNotes ? item.addlNotes(language) : null, group: item.group, - event: item.event, value: item.goldValue ? item.goldValue : item.value, locked, previous: content.quests[item.previous] @@ -193,7 +189,6 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang class: `inventory_special_${item.key}`, path: `spells.special.${item.key}`, pinType: 'seasonalSpell', - event: item.event, }; break; case 'debuffPotion':