From 264c9981ff5f21b55f85547a3d06fe77eb5e6413 Mon Sep 17 00:00:00 2001 From: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> Date: Wed, 4 Sep 2024 13:34:27 -0600 Subject: [PATCH] MWPW-157693 [MEP] Action area simplified selector does not work well with hero-marquee block (#2827) * Make action-area more flexible * unit test update --- libs/features/personalization/personalization.js | 2 +- test/features/personalization/modifyNonFragmentSelector.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/features/personalization/personalization.js b/libs/features/personalization/personalization.js index 29cfddd65d..d32285ed41 100644 --- a/libs/features/personalization/personalization.js +++ b/libs/features/personalization/personalization.js @@ -358,7 +358,7 @@ function modifySelectorTerm(termParam) { section: 'main > div', 'primary-cta': 'p strong a', 'secondary-cta': 'p em a', - 'action-area': 'p:has(em a, strong a)', + 'action-area': '*:has(> em a, > strong a)', }; const otherSelectors = ['row', 'col']; const htmlEls = ['main', 'div', 'a', 'p', 'strong', 'em', 'picture', 'source', 'img', 'h']; diff --git a/test/features/personalization/modifyNonFragmentSelector.test.js b/test/features/personalization/modifyNonFragmentSelector.test.js index 56db63e300..7b977c3874 100644 --- a/test/features/personalization/modifyNonFragmentSelector.test.js +++ b/test/features/personalization/modifyNonFragmentSelector.test.js @@ -4,7 +4,7 @@ import { modifyNonFragmentSelector } from '../../../libs/features/personalizatio const values = [ { b: 'main section1 marquee action-area', - a: 'main > div:nth-child(1) .marquee p:has(em a, strong a)', + a: 'main > div:nth-child(1) .marquee *:has(> em a, > strong a)', }, { b: 'main > section1 .marquee h2',