Skip to content

Commit

Permalink
adding unit test for aria-label
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchoi-dev committed Jan 22, 2025
1 parent 2cf9f9a commit b5b50ad
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/blocks/merch-card/merch-card.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,4 +576,16 @@ describe('Product Merch Card', () => {
const lowerBodySlot = merchCard.querySelector('[slot="body-lower"]');
expect(lowerBodySlot).to.exist;
});

describe('Aria Label', () => {
it('Supports aria-label', async () => {
document.body.innerHTML = await readMockText('/test/blocks/merch-card/mocks/product.html');
const merchCard = await init(document.querySelector('.product'));
const ctaLink = merchCard.querySelector('.action-area a');
ctaLink.value = [{ productArrangement: { productFamily: 'ARIA' } }];
ctaLink.dispatchEvent(new Event('mas:resolved'));
await delay();
expect(ctaLink.getAttribute('aria-label')).to.exist;
});
});
});

0 comments on commit b5b50ad

Please sign in to comment.