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
This commit is contained in:
Sabe Jones 2016-08-31 17:16:22 -05:00 committed by GitHub
parent 75eb1b11cf
commit cb1417ea58
3 changed files with 2 additions and 7 deletions

View file

@ -78,6 +78,7 @@ shops.getMarketCategories = function getMarket (user, language) {
purchaseType: 'hatchingPotions',
};
}).sortBy('key').value();
categories.push(premiumHatchingPotionsCategory);
let foodCategory = {
identifier: 'food',

View file

@ -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) => {

View file

@ -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')