diff --git a/libs/features/personalization/personalization.js b/libs/features/personalization/personalization.js index 4116d17d9d..cd571934b4 100644 --- a/libs/features/personalization/personalization.js +++ b/libs/features/personalization/personalization.js @@ -417,7 +417,7 @@ async function getPersonalizationVariant(manifestPath, variantNames = [], varian if (config.mep?.override) { let manifest; /* c8 ignore start */ - config.mep?.override?.split(',').some((item) => { + config.mep?.override?.split('---').some((item) => { const pair = item.trim().split('--'); if (pair[0] === manifestPath && pair.length > 1) { [, manifest] = pair; diff --git a/libs/features/personalization/preview.js b/libs/features/personalization/preview.js index c17923241c..2fe0e790fe 100644 --- a/libs/features/personalization/preview.js +++ b/libs/features/personalization/preview.js @@ -28,7 +28,7 @@ function updatePreviewButton() { }); const simulateHref = new URL(window.location.href); - simulateHref.searchParams.set('mep', manifestParameter.join(',')); + simulateHref.searchParams.set('mep', manifestParameter.join('---')); const mepHighlightCheckbox = document.querySelector( '.mep-popup input[type="checkbox"]#mepHighlightCheckbox', @@ -203,7 +203,7 @@ function createPreviewPill(manifests) { const personalizationOn = getMetadata('personalization'); const personalizationOnText = personalizationOn && personalizationOn !== '' ? 'on' : 'off'; const simulateHref = new URL(window.location.href); - simulateHref.searchParams.set('manifest', manifestParameter.join(',')); + simulateHref.searchParams.set('manifest', manifestParameter.join('---')); const config = getConfig(); let mepHighlightChecked = ''; diff --git a/test/features/personalization/preview.test.js b/test/features/personalization/preview.test.js index b3b9b13c70..51feed86e1 100644 --- a/test/features/personalization/preview.test.js +++ b/test/features/personalization/preview.test.js @@ -185,6 +185,7 @@ describe('preview feature', () => { expect(document.querySelector('input#mepHighlightCheckbox').getAttribute('checked')).to.equal('checked'); }); it('updates preview button', () => { + expect(document.querySelector('a[title="Preview above choices"]').getAttribute('href')).to.contain('---'); document.querySelector('#new-manifest').value = 'https://main--homepage--adobecom.hlx.live/homepage/fragments/mep/new-manifest.json'; document.querySelector('input[name="/homepage/fragments/mep/selected-example.json"][value="default"]').click(); expect(document.querySelector('a[title="Preview above choices"]').getAttribute('href')).to.contain('new-manifest.json'); @@ -193,6 +194,7 @@ describe('preview feature', () => { expect(document.querySelector('a[title="Preview above choices"]').getAttribute('href')).to.not.contain('mepHighlight'); document.querySelector('input#mepPreviewButtonCheckbox').click(); expect(document.querySelector('a[title="Preview above choices"]').getAttribute('href')).to.contain('mepButton=off'); + expect(document.querySelector('a[title="Preview above choices"]').getAttribute('href')).to.contain('---'); }); it('opens manifest', () => { document.querySelector('a.mep-edit-manifest').click();