From 05d6b037cbf42c6918241f4582cda4f678de6309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilyas=20T=C3=BCrkben?= Date: Wed, 30 Oct 2024 17:59:33 +0100 Subject: [PATCH] improve code coverage --- libs/features/mas/web-components/src/hydrate.js | 1 + libs/features/mas/web-components/test/hydrate.test.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/features/mas/web-components/src/hydrate.js b/libs/features/mas/web-components/src/hydrate.js index 9c4ad41a7e..394a32465a 100644 --- a/libs/features/mas/web-components/src/hydrate.js +++ b/libs/features/mas/web-components/src/hydrate.js @@ -184,6 +184,7 @@ function createSpectrumButton(cta, strong, aemFragmentMapping, cardVariant) { spectrumCta.addEventListener('click', (e) => { if (e.target !== cta) { + /* c8 ignore next 3 */ e.stopPropagation(); cta.click(); } diff --git a/libs/features/mas/web-components/test/hydrate.test.js b/libs/features/mas/web-components/test/hydrate.test.js index 7b97126d54..4613e7cf03 100644 --- a/libs/features/mas/web-components/test/hydrate.test.js +++ b/libs/features/mas/web-components/test/hydrate.test.js @@ -137,10 +137,11 @@ describe('processCTAs', async () => { it('should handle link-style CTAs', async () => { const fragment = { - ctas: 'Link Style', + ctas: `Link Style + Link Style`, }; - processCTAs(fragment, merchCard, aemFragmentMapping); + processCTAs(fragment, merchCard, aemFragmentMapping, 'ccd-suggested'); const footer = merchCard.append.firstCall.args[0]; const link = footer.firstChild;