Lets the price banner work with empty fields
Only the banner title is required; description, price, price note, features and the button label are left out when empty (the button then says Neem contact op). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -97,6 +97,34 @@ describe('mapOfferings', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('neemt een banner met alleen een titel; lege velden blijven leeg', () => {
|
||||
const result = mapOfferings([
|
||||
card(),
|
||||
card({
|
||||
slug: 'actie',
|
||||
title: 'Past er niets bij?',
|
||||
description: '',
|
||||
price: '',
|
||||
priceNote: '',
|
||||
ctaLabel: '',
|
||||
features: [],
|
||||
layout: 'banner',
|
||||
}),
|
||||
]);
|
||||
expect(result?.banner).toEqual({
|
||||
title: 'Past er niets bij?',
|
||||
description: undefined,
|
||||
priceText: undefined,
|
||||
priceNote: undefined,
|
||||
features: [],
|
||||
ctaLabel: undefined,
|
||||
});
|
||||
expect(
|
||||
mapOfferings([card(), card({ title: ' ', layout: 'banner' })])
|
||||
?.banner,
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it('slaat ongeldige kaarten over en behoudt de rest', () => {
|
||||
const result = mapOfferings([
|
||||
card({ slug: 'Slecht Id' }),
|
||||
|
||||
Reference in New Issue
Block a user