groceries/picnic: label the Picnic Family member discount
Deploy production / deploy (push) Successful in 1m22s

This commit is contained in:
stan committed 2026-10-27 09:19:40 +00:00
1 parent c094754c5b
commit e1e2bee590
2 files changed
+10 -1

No files matched your search

+4
View File
@@ -57,6 +57,10 @@ describe('picnicItem', () => {
imageUrl: 'https://storefront-prod.nl.picnicinternational.com/static/images/abc/medium.png' imageUrl: 'https://storefront-prod.nl.picnicinternational.com/static/images/abc/medium.png'
}); });
}); });
it('names the Picnic Family member discount', () => {
const fam = { ...base, labels: {}, discountInfo: { label: 'Family' } };
expect(picnicItem(fam, TOP['21730'], 'x')?.promoLabel).toBe('Picnic Family-korting');
});
it('maps a regular and an unavailable tile', () => { it('maps a regular and an unavailable tile', () => {
const regular = { ...base, labels: {}, price: { priceValue: 0.84 } }; const regular = { ...base, labels: {}, price: { priceValue: 0.84 } };
expect(picnicItem(regular, TOP['21730'], 'x')).toMatchObject({ expect(picnicItem(regular, TOP['21730'], 'x')).toMatchObject({
+6 -1
View File
@@ -123,7 +123,12 @@ export function picnicItem(
sizeText: texts[0]?.trim() || null, sizeText: texts[0]?.trim() || null,
priceCents: promo ? ref : now, priceCents: promo ? ref : now,
promoPriceCents: promo, promoPriceCents: promo,
promoLabel: promo ? promoText?.trim() || 'Actie' : null, // "Family" is Picnic's member discount (Picnic Family), not a store-wide promo.
promoLabel: promo
? promoText?.trim() === 'Family'
? 'Picnic Family-korting'
: promoText?.trim() || 'Actie'
: null,
storeUnitPrice: null, storeUnitPrice: null,
storeUnitBasisCents: null, storeUnitBasisCents: null,
category: cat.category, category: cat.category,