From cb1417ea5804f6d8477af71b7a5fad5d9f9910d8 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Wed, 31 Aug 2016 17:16:22 -0500 Subject: [PATCH] Handle empty market category on Drops page (#7959) * fix(market): hide category in view * refactor(view): if, not hide * fix(test): allow empty market cat --- common/script/libs/shops.js | 1 + test/common/libs/shops.js | 6 ------ website/views/options/inventory/drops.jade | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/common/script/libs/shops.js b/common/script/libs/shops.js index 422164565b..a4fc7905fd 100644 --- a/common/script/libs/shops.js +++ b/common/script/libs/shops.js @@ -78,6 +78,7 @@ shops.getMarketCategories = function getMarket (user, language) { purchaseType: 'hatchingPotions', }; }).sortBy('key').value(); + categories.push(premiumHatchingPotionsCategory); let foodCategory = { identifier: 'food', diff --git a/test/common/libs/shops.js b/test/common/libs/shops.js index 47f26eb542..0ae721cbc9 100644 --- a/test/common/libs/shops.js +++ b/test/common/libs/shops.js @@ -19,12 +19,6 @@ describe('shops', () => { 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); - }); - }); - it('items contain required fields', () => { _.each(shopCategories, (category) => { _.each(category.items, (item) => { diff --git a/website/views/options/inventory/drops.jade b/website/views/options/inventory/drops.jade index 5c8cb6445b..7b3704a04a 100644 --- a/website/views/options/inventory/drops.jade +++ b/website/views/options/inventory/drops.jade @@ -107,7 +107,7 @@ menu.inventory-list(type='list') li.customize-menu(ng-repeat='category in marketShopCategories') - menu.pets-menu(label='{{category.text}}') + menu.pets-menu(label='{{category.text}}', ng-if='category.items.length > 0') p.muted(ng-bind-html='category.notes') div(ng-repeat='item in category.items')