groceries/picnic: label the Picnic Family member discount
Deploy production / deploy (push) Successful in 1m22s
Deploy production / deploy (push) Successful in 1m22s
This commit is contained in:
1 parent
c094754c5b
commit
e1e2bee590
2 files changed
+10
-1
No files matched your search
@@ -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({
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in new issue
Block a user