mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Steampunk gear should not have an end date (#15256)
This commit is contained in:
@@ -341,6 +341,16 @@ describe('shops', () => {
|
|||||||
const backgrounds = shopCategories.find(cat => cat.identifier === 'backgrounds').items;
|
const backgrounds = shopCategories.find(cat => cat.identifier === 'backgrounds').items;
|
||||||
expect(backgrounds.length).to.be.greaterThan(0);
|
expect(backgrounds.length).to.be.greaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not add an end date to steampunk gear', () => {
|
||||||
|
const categories = shopCategories.filter(cat => cat.identifier.startsWith('30'));
|
||||||
|
categories.forEach(category => {
|
||||||
|
expect(category.end).to.not.exist;
|
||||||
|
category.items.forEach(item => {
|
||||||
|
expect(item.end).to.not.exist;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('customizationShop', () => {
|
describe('customizationShop', () => {
|
||||||
|
|||||||
@@ -404,22 +404,30 @@ shops.getTimeTravelersCategories = function getTimeTravelersCategories (user, la
|
|||||||
path: `mystery.${set.key}`,
|
path: `mystery.${set.key}`,
|
||||||
pinType: 'mystery_set',
|
pinType: 'mystery_set',
|
||||||
purchaseAll: true,
|
purchaseAll: true,
|
||||||
end: Number(set.key) < 300000 ? availabilityMatchers.end : null,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
category.items = map(set.items, item => ({
|
if (!set.key.startsWith('30')) {
|
||||||
key: item.key,
|
category.end = availabilityMatchers.end;
|
||||||
text: item.text(language),
|
}
|
||||||
notes: item.notes(language),
|
|
||||||
type: item.type,
|
category.items = map(set.items, item => {
|
||||||
purchaseType: 'gear',
|
const shopItem = {
|
||||||
value: 1,
|
key: item.key,
|
||||||
locked: false,
|
text: item.text(language),
|
||||||
currency: 'hourglasses',
|
notes: item.notes(language),
|
||||||
class: `shop_${item.key}`,
|
type: item.type,
|
||||||
pinKey: `timeTravelers!gear.flat.${item.key}`,
|
purchaseType: 'gear',
|
||||||
end: availabilityMatchers.end,
|
value: 1,
|
||||||
}));
|
locked: false,
|
||||||
|
currency: 'hourglasses',
|
||||||
|
class: `shop_${item.key}`,
|
||||||
|
pinKey: `timeTravelers!gear.flat.${item.key}`,
|
||||||
|
};
|
||||||
|
if (!item.set.startsWith('mystery-30')) {
|
||||||
|
shopItem.end = availabilityMatchers.end;
|
||||||
|
}
|
||||||
|
return shopItem;
|
||||||
|
});
|
||||||
if (category.items.length > 0) {
|
if (category.items.length > 0) {
|
||||||
categories.push(category);
|
categories.push(category);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user