From 2d553417b437fae4010318a899157e609421a1bd Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Tue, 9 Aug 2016 22:21:54 -0500 Subject: [PATCH] fix(api): Correct identifier for magic hatching potions --- common/script/libs/shops.js | 2 +- test/common/libs/shops.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/common/script/libs/shops.js b/common/script/libs/shops.js index 9701d42fe6..9afc32a8e3 100644 --- a/common/script/libs/shops.js +++ b/common/script/libs/shops.js @@ -59,7 +59,7 @@ shops.getMarketCategories = function getMarket (user, language) { categories.push(hatchingPotionsCategory); let premiumHatchingPotionsCategory = { - identifier: 'hatchingPotions', + identifier: 'magicHatchingPotions', text: i18n.t('magicHatchingPotions', language), notes: i18n.t('premiumPotionNoDropExplanation', language), }; diff --git a/test/common/libs/shops.js b/test/common/libs/shops.js index 16fce945b1..bea676b588 100644 --- a/test/common/libs/shops.js +++ b/test/common/libs/shops.js @@ -13,6 +13,12 @@ describe('shops', () => { expect(shopCategories.length).to.be.greaterThan(2); }); + it('does not duplicate identifiers', () => { + let identifiers = Array.from(new Set(shopCategories.map(cat => cat.identifier))) + + expect(identifiers.length).to.eql(shopCategories.length); + }); + it('does not contain an empty category', () => { _.each(shopCategories, (category) => { expect(category.items.length).to.be.greaterThan(0); @@ -37,6 +43,12 @@ describe('shops', () => { }); }); + it('does not duplicate identifiers', () => { + let identifiers = Array.from(new Set(shopCategories.map(cat => cat.identifier))) + + expect(identifiers.length).to.eql(shopCategories.length); + }); + it('items contain required fields', () => { _.each(shopCategories, (category) => { _.each(category.items, (item) => { @@ -55,6 +67,12 @@ describe('shops', () => { }); }); + it('does not duplicate identifiers', () => { + let identifiers = Array.from(new Set(shopCategories.map(cat => cat.identifier))) + + expect(identifiers.length).to.eql(shopCategories.length); + }); + it('items contain required fields', () => { _.each(shopCategories, (category) => { _.each(category.items, (item) => { @@ -73,6 +91,12 @@ describe('shops', () => { }); }); + it('does not duplicate identifiers', () => { + let identifiers = Array.from(new Set(shopCategories.map(cat => cat.identifier))) + + expect(identifiers.length).to.eql(shopCategories.length); + }); + it('items contain required fields', () => { _.each(shopCategories, (category) => { _.each(category.items, (item) => {