Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yesil committed May 28, 2024
1 parent 92dab37 commit 66fa715
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libs/blocks/merch-card/merch-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,16 +417,16 @@ export default async function init(el) {
merchCard.setAttribute('filters', categories.join(','));
merchCard.setAttribute('types', types.join(','));

const footer = createTag('div', { slot: 'footer' });
if (ctas) {
if (merchCard.variant === 'mini-compare-chart') {
decorateButtons(ctas, 'button-l');
} else {
decorateButtons(ctas);
}
const footer = createTag('div', { slot: 'footer' });
footer.append(ctas);
merchCard.appendChild(footer);
}
merchCard.appendChild(footer);

if (MULTI_OFFER_CARDS.includes(cardType)) {
if (merchCard.variant === MINI_COMPARE_CHART) {
Expand Down
5 changes: 3 additions & 2 deletions libs/blocks/merch-card/merch-offer-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ function createDynamicSlots(el, bodySlot) {
createTag('span', { slot: 'price', is: 'inline-price' }, null, { parent: priceSlot });
bodySlot.append(priceSlot);
}
const p = createTag('p', { class: 'action-area', slot: 'footer' });
const p = createTag('p', { class: 'action-area' });
createTag('a', { slot: 'secondary-cta', is: 'checkout-link' }, null, { parent: p });
createTag('a', { slot: 'cta', is: 'checkout-link' }, null, { parent: p });
el.append(p);
const footer = el.querySelector('div[slot="footer"]');
footer.append(p);
bodySlot.querySelector('p')?.setAttribute('slot', 'description');
if (el.variant === MINI_COMPARE_CHART) {
const description = el.querySelector('div[slot="body-m"] p:last-child');
Expand Down

0 comments on commit 66fa715

Please sign in to comment.