Skip to content

Commit

Permalink
update the test to avoid fail
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchoi-dev committed Jan 23, 2025
1 parent 37715d4 commit 4b7b53d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions libs/blocks/merch-card/merch-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ export default async function init(el) {
if (!ctaLink.getAttribute('aria-label')) {
const { replaceKey } = await import('../../features/placeholders.js');
ctaLink.addEventListener('mas:resolved', async () => {
console.log('mas:resolved');
const productName = ctaLink.value[0]?.productArrangement?.productFamily;
if (productName) {
await replaceKey(productName, getConfig()).then((label) => {
Expand Down
1 change: 1 addition & 0 deletions test/blocks/merch-card/merch-card.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ describe('Product Merch Card', () => {
it('Supports aria-label', async () => {
document.body.innerHTML = await readMockText('/test/blocks/merch-card/mocks/product.html');
const merchCard = await init(document.querySelector('.product'));
await delay();
const ctaLink = merchCard.querySelector('.action-area a');
ctaLink.value = [{ productArrangement: { productFamily: 'ARIA' } }];
ctaLink.dispatchEvent(new Event('mas:resolved'));
Expand Down

0 comments on commit 4b7b53d

Please sign in to comment.