From 3aacc6d1b329a508225da0b9fbf48ef5fa3d38b6 Mon Sep 17 00:00:00 2001 From: sonawanesnehal3 <152426902+sonawanesnehal3@users.noreply.github.com> Date: Thu, 6 Feb 2025 23:20:46 +0530 Subject: [PATCH 01/13] MWPW-158537 : Upgrade Universal Nav to version 1.4 (#3633) * Unav upgrade 1.4 * Adding scopes for ProfileSwitching * Enabling new mobile tray experience * Updated for unav reload for mobile tray * Fixing profile switching * Adding unit tests * Adding UT * IDACTMGT-17106 and addressing review comments * Adding fix for MWPW-166074 * Adding additional checks * Adding additional checks --------- Co-authored-by: Snehal Sonawane Co-authored-by: Snehal Sonawane --- .../global-navigation/global-navigation.css | 1 - .../global-navigation/global-navigation.js | 37 ++++++++++++++----- libs/utils/utils.js | 2 +- .../global-navigation.test.js | 30 +++++++++++++++ .../global-navigation/test-utilities.js | 2 +- 5 files changed, 59 insertions(+), 13 deletions(-) diff --git a/libs/blocks/global-navigation/global-navigation.css b/libs/blocks/global-navigation/global-navigation.css index dad2da2b13..f4552eb6d2 100644 --- a/libs/blocks/global-navigation/global-navigation.css +++ b/libs/blocks/global-navigation/global-navigation.css @@ -406,7 +406,6 @@ header.global-navigation { .feds-utilities .unav-comp-app-switcher-popover, /* App Switcher */ .feds-utilities .spectrum-Dialog-content, /* Notifications */ -.feds-utilities .unav-comp-external-profile, /* Profile */ .feds-utilities .unav-comp-help-popover, /* Help */ .feds-utilities .unc-overlay-container { /* Tooltips */ transform: translate3d(0,0,0); /* Fix Safari issues w/ position: sticky */ diff --git a/libs/blocks/global-navigation/global-navigation.js b/libs/blocks/global-navigation/global-navigation.js index 62e2d7e2bf..94be57cfc8 100644 --- a/libs/blocks/global-navigation/global-navigation.js +++ b/libs/blocks/global-navigation/global-navigation.js @@ -78,17 +78,32 @@ export const CONFIG = { name: 'profile', attributes: { isSignUpRequired: false, + messageEventListener: (event) => { + const { name, payload, executeDefaultAction } = event.detail; + if (!name || name !== 'System' || !payload || typeof executeDefaultAction !== 'function') return; + switch (payload.subType) { + case 'AppInitiated': + window.adobeProfile?.getUserProfile() + .then((data) => { setUserProfile(data); }) + .catch(() => { setUserProfile({}); }); + break; + case 'SignOut': + executeDefaultAction(); + break; + case 'ProfileSwitch': + Promise.resolve(executeDefaultAction()).then((profile) => { + if (profile) window.location.reload(); + }); + break; + default: + break; + } + }, componentLoaderConfig: { config: { enableLocalSection: true, + enableProfileSwitcher: true, miniAppContext: { - onMessage: (name, payload) => { - if (name === 'System' && payload.subType === 'AppInitiated') { - window.adobeProfile?.getUserProfile() - .then((data) => { setUserProfile(data); }) - .catch(() => { setUserProfile({}); }); - } - }, logger: { trace: () => {}, debug: () => {}, @@ -129,6 +144,7 @@ export const CONFIG = { callbacks: getConfig().jarvis?.callbacks, }, }, + cart: { name: 'cart' }, }, }, }; @@ -262,7 +278,7 @@ const closeOnClickOutside = (e, isLocalNav, navWrapper) => { const newMobileNav = getMetadata('mobile-gnav-v2') !== 'false'; if (!isDesktop.matches && !newMobileNav) return; - const openElemSelector = `${selectors.globalNav} [aria-expanded = "true"], ${selectors.localNav} [aria-expanded = "true"]`; + const openElemSelector = `${selectors.globalNav} [aria-expanded = "true"]:not(.universal-nav-container *), ${selectors.localNav} [aria-expanded = "true"]`; const isClickedElemOpen = [...document.querySelectorAll(openElemSelector)] .find((openItem) => openItem.parentElement.contains(e.target)); @@ -645,7 +661,7 @@ class Gnav { return 'linux'; }; - const unavVersion = new URLSearchParams(window.location.search).get('unavVersion') || '1.3'; + const unavVersion = new URLSearchParams(window.location.search).get('unavVersion') || '1.4'; await Promise.all([ loadScript(`https://${environment}.adobeccstatic.com/unav/${unavVersion}/UniversalNav.js`), loadStyles(`https://${environment}.adobeccstatic.com/unav/${unavVersion}/UniversalNav.css`, true), @@ -745,6 +761,7 @@ class Gnav { }, children: getChildren(), isSectionDividerRequired: getConfig()?.unav?.showSectionDivider, + showTrayExperience: (!isDesktop.matches), }); // Exposing UNAV config for consumers @@ -752,7 +769,7 @@ class Gnav { await window.UniversalNav(CONFIG.universalNav.universalNavConfig); this.decorateAppPrompt({ getAnchorState: () => window.UniversalNav.getComponent?.('app-switcher') }); isDesktop.addEventListener('change', () => { - window.UniversalNav.reload(CONFIG.universalNav.universalNavConfig); + window.UniversalNav.reload(getConfiguration()); }); }; diff --git a/libs/utils/utils.js b/libs/utils/utils.js index 615da1c990..3e9d7973c4 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -1023,7 +1023,7 @@ export async function loadIms() { return; } const [unavMeta, ahomeMeta] = [getMetadata('universal-nav')?.trim(), getMetadata('adobe-home-redirect')]; - const defaultScope = `AdobeID,openid,gnav${unavMeta && unavMeta !== 'off' ? ',pps.read,firefly_api,additional_info.roles,read_organizations' : ''}`; + const defaultScope = `AdobeID,openid,gnav${unavMeta && unavMeta !== 'off' ? ',pps.read,firefly_api,additional_info.roles,read_organizations,account_cluster.read' : ''}`; const timeout = setTimeout(() => reject(new Error('IMS timeout')), imsTimeout || 5000); window.adobeid = { client_id: imsClientId, diff --git a/test/blocks/global-navigation/global-navigation.test.js b/test/blocks/global-navigation/global-navigation.test.js index 04f517ac7c..f7352f2d5b 100644 --- a/test/blocks/global-navigation/global-navigation.test.js +++ b/test/blocks/global-navigation/global-navigation.test.js @@ -398,6 +398,7 @@ describe('global navigation', () => { }); window.UniversalNav = sinon.spy(() => Promise.resolve()); window.UniversalNav.reload = sinon.spy(() => Promise.resolve()); + window.adobeProfile = { getUserProfile: sinon.spy(() => Promise.resolve({})) }; // eslint-disable-next-line no-underscore-dangle window._satellite = { track: sinon.spy() }; window.alloy = () => new Promise((resolve) => { @@ -432,6 +433,27 @@ describe('global navigation', () => { expect(window.UniversalNav.reload.getCall(0)).to.exist; }); + it('should handle message events correctly', async () => { + // eslint-disable-next-line max-len + const mockEvent = (name, payload) => ({ detail: { name, payload, executeDefaultAction: sinon.spy(() => Promise.resolve(null)) } }); + await createFullGlobalNavigation({ unavContent: 'on' }); + const messageEventListener = window.UniversalNav.getCall(0).args[0].children + .map((c) => c.attributes.messageEventListener) + .find((listener) => listener); + + const appInitiatedEvent = mockEvent('System', { subType: 'AppInitiated' }); + messageEventListener(appInitiatedEvent); + expect(window.adobeProfile.getUserProfile.called).to.be.true; + + const signOutEvent = mockEvent('System', { subType: 'SignOut' }); + messageEventListener(signOutEvent); + expect(signOutEvent.detail.executeDefaultAction.called).to.be.true; + + const profileSwitch = mockEvent('System', { subType: 'ProfileSwitch' }); + messageEventListener(profileSwitch); + expect(profileSwitch.detail.executeDefaultAction.called).to.be.true; + }); + it('should send the correct analytics events', async () => { await createFullGlobalNavigation({ unavContent: 'on' }); const analyticsFn = window.UniversalNav.getCall(0) @@ -486,6 +508,14 @@ describe('global navigation', () => { expect(getUniversalNavLocale({ prefix: data.prefix })).to.equal(data.expectedLocale); } }); + + it('should pass enableProfileSwitcher to the profile component configuration', async () => { + await createFullGlobalNavigation({ unavContent: 'on' }); + const profileConfig = window.UniversalNav.getCall(0).args[0].children + .find((c) => c.name === 'profile').attributes.componentLoaderConfig.config; + + expect(profileConfig.enableProfileSwitcher).to.be.true; + }); }); describe('small desktop', () => { diff --git a/test/blocks/global-navigation/test-utilities.js b/test/blocks/global-navigation/test-utilities.js index a32b195f48..0cd594ed52 100644 --- a/test/blocks/global-navigation/test-utilities.js +++ b/test/blocks/global-navigation/test-utilities.js @@ -80,7 +80,7 @@ export const analyticsTestData = { 'unc|click|markUnread': 'Mark Notification as unread', }; -export const unavVersion = '1.3'; +export const unavVersion = '1.4'; export const addMetaDataV2 = (value) => { const metaTag = document.createElement('meta'); From 79770f8e17b42d1cebe118a9a3d451050a67df50 Mon Sep 17 00:00:00 2001 From: Akansha Arora Date: Thu, 6 Feb 2025 23:20:55 +0530 Subject: [PATCH 02/13] Datastream Bug (#3638) * Datastream Bug * Datastream Bug --------- Co-authored-by: Akansha Arora <> --- libs/martech/helpers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/martech/helpers.js b/libs/martech/helpers.js index 630188e042..a54cc7dc10 100644 --- a/libs/martech/helpers.js +++ b/libs/martech/helpers.js @@ -4,8 +4,9 @@ const KNDCTR_COOKIE_KEYS = [ 'kndctr_9E1005A551ED61CA0A490D45_AdobeOrg_identity', 'kndctr_9E1005A551ED61CA0A490D45_AdobeOrg_cluster', ]; + const DATA_STREAM_IDS_PROD = { - firstVisitNoConsent: '7c20bab-94c3-425e-95cb-0b9948b1fdd4', + firstVisitNoConsent: '57c20bab-94c3-425e-95cb-0b9948b1fdd4', default: '913eac4d-900b-45e8-9ee7-306216765cd2', }; const DATA_STREAM_IDS_STAGE = { From 9bc86d31595ec13e2eb30d5819b44c2d88ce1733 Mon Sep 17 00:00:00 2001 From: Megan Thomas Date: Thu, 6 Feb 2025 09:51:10 -0800 Subject: [PATCH 03/13] MWPW-165881 Align Chart Heights (#3583) --- libs/blocks/chart/chart.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/blocks/chart/chart.css b/libs/blocks/chart/chart.css index eafead2d0c..5d4ff1253a 100644 --- a/libs/blocks/chart/chart.css +++ b/libs/blocks/chart/chart.css @@ -7,7 +7,7 @@ display: flex; flex-wrap: wrap; justify-content: center; - align-items: flex-start; + align-items: stretch; gap: 16px; margin: 0 auto; } From bcd4d2ecbed557b1728ee3f8d9cde673ba26f952 Mon Sep 17 00:00:00 2001 From: Ratko Zagorac <90400759+zagi25@users.noreply.github.com> Date: Thu, 6 Feb 2025 18:51:41 +0100 Subject: [PATCH 04/13] MWPW-164756: Fix inset text ol (#3627) --- libs/blocks/text/text.css | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/blocks/text/text.css b/libs/blocks/text/text.css index 6242f50132..03cea2310e 100644 --- a/libs/blocks/text/text.css +++ b/libs/blocks/text/text.css @@ -201,7 +201,6 @@ .inset.text-block .foreground ul, .inset.text-block .foreground ol { - list-style: outside; padding-left: var(--spacing-xs); } From 191dd6ba7e45ba908c0a3301d3342282f09b8d67 Mon Sep 17 00:00:00 2001 From: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> Date: Thu, 6 Feb 2025 10:52:02 -0700 Subject: [PATCH 05/13] MWPW-167263 [MEP] Error if a page with undefined promo uses mep param (#3632) add question mark --- libs/features/personalization/personalization.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/features/personalization/personalization.js b/libs/features/personalization/personalization.js index d3d1b9a0d4..92e5beb93f 100644 --- a/libs/features/personalization/personalization.js +++ b/libs/features/personalization/personalization.js @@ -1121,7 +1121,7 @@ export const combineMepSources = async (persEnabled, promoEnabled, mepParam) => if (mepParam && mepParam !== 'off') { const persManifestPaths = persManifests.map((manifest) => { const { manifestPath } = manifest; - if (manifestPath.startsWith('/')) return manifestPath; + if (manifestPath?.startsWith('/')) return manifestPath; try { const url = new URL(manifestPath); return url.pathname; From c2e64efd659572f754810a05629ddb1713db983c Mon Sep 17 00:00:00 2001 From: Robert Bogos <146744221+robert-bogos@users.noreply.github.com> Date: Thu, 6 Feb 2025 19:52:07 +0200 Subject: [PATCH 06/13] [MWPW-167165] Fix for vimeo video not showing in modal (#3636) * fix for modal video not showing * fix for vimeo video not showing in modal --- libs/blocks/modal/modal.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/blocks/modal/modal.css b/libs/blocks/modal/modal.css index b20f93e686..99465bf4e9 100644 --- a/libs/blocks/modal/modal.css +++ b/libs/blocks/modal/modal.css @@ -238,6 +238,10 @@ width: fit-content; } + .dialog-modal .embed-vimeo { + min-width: 80vw; + } + .dialog-modal.tall-video { --modal-width-var: 50vw; From 02c5552d1189deb258a5c87660c095f28fcf19c8 Mon Sep 17 00:00:00 2001 From: Robert Bogos <146744221+robert-bogos@users.noreply.github.com> Date: Thu, 6 Feb 2025 22:15:20 +0200 Subject: [PATCH 07/13] [MWPW-152453] Overriding description elements for accordion (#3613) * overriding descr elements for accordion * hotfix * fixed unit tests * fixed nala tests * fixed editorial-accordion unit tests --- libs/blocks/accordion/accordion.css | 64 +++++++++---------- libs/blocks/accordion/accordion.js | 10 +-- nala/blocks/accordion/accordion.page.js | 4 +- test/blocks/accordion/accordion.test.js | 4 +- .../accordion/editorial-accordion.test.js | 4 +- 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/libs/blocks/accordion/accordion.css b/libs/blocks/accordion/accordion.css index c979c3557a..0dbd9e5523 100644 --- a/libs/blocks/accordion/accordion.css +++ b/libs/blocks/accordion/accordion.css @@ -2,28 +2,28 @@ padding: var(--spacing-m) 0; } -div.accordion { +div.accordion:not(.descr-list) { display: none; } -dl.accordion { +.descr-list.accordion { margin: 0 auto; max-width: var(--grid-container-width); border-bottom: 1px solid var(--color-gray-500); } -.accordion-container.no-borders dl.accordion { +.accordion-container.no-borders .descr-list.accordion { border: none; } -.accordion dd { +.accordion .descr-details { margin: 0; padding: var(--spacing-xs); font-size: var(--type-body-s-size); line-height: var(--type-body-s-lh); } -.accordion dt button { +.accordion .descr-term button { align-items: center; background: none; border: 1px solid var(--color-gray-500); @@ -41,16 +41,16 @@ dl.accordion { -webkit-text-size-adjust: 100%; } -.accordion dt button:hover { +.accordion .descr-term button:hover { cursor: pointer; color: var(--color-black); } -.accordion-container.no-borders .accordion dt button { +.accordion-container.no-borders .accordion .descr-term button { border: none; } -.accordion dt .accordion-heading { +.accordion .descr-term .accordion-heading { margin: 0; } @@ -91,7 +91,7 @@ html[dir="rtl"] .accordion-icon { height: 2px; } -.accordion dt button::before { +.accordion .descr-term button::before { content: ""; display: block; position: absolute; @@ -102,72 +102,72 @@ html[dir="rtl"] .accordion-icon { background-color: transparent; } -.accordion dt button[aria-expanded="true"]::before { +.accordion .descr-term button[aria-expanded="true"]::before { background-color: var(--link-color-dark); } -.quiet .accordion dt button[aria-expanded="true"]::before { +.quiet .accordion .descr-term button[aria-expanded="true"]::before { display: none; } -.accordion dt button[aria-expanded="true"] .accordion-icon::before, -.accordion dt button[aria-expanded="true"] .accordion-icon::after { +.accordion .descr-term button[aria-expanded="true"] .accordion-icon::before, +.accordion .descr-term button[aria-expanded="true"] .accordion-icon::after { transform: rotate(90deg); } -.accordion dt button[aria-expanded="true"] .accordion-icon::after { +.accordion .descr-term button[aria-expanded="true"] .accordion-icon::after { opacity: 0; } -.accordion dt button:hover .accordion-icon::before, -.accordion dt button:hover .accordion-icon::after { +.accordion .descr-term button:hover .accordion-icon::before, +.accordion .descr-term button:hover .accordion-icon::after { background: var(--color-black); } -.accordion dt button:focus, -.accordion dt button:hover, -.accordion dt button[aria-expanded="true"] { +.accordion .descr-term button:focus, +.accordion .descr-term button:hover, +.accordion .descr-term button[aria-expanded="true"] { background: #00000005; } -.accordion dd p:first-child { +.accordion .descr-details p:first-child { margin-top: 0; } /* dark */ -.dark .accordion dt button, -.darkest .accordion dt button { +.dark .accordion .descr-term button, +.darkest .accordion .descr-term button { color: #fff; } -.dark dl.accordion { +.dark .descr-list.accordion { border-bottom-color: var(--color-gray-600); } -.dark .accordion dt button { +.dark .accordion .descr-term button { border-top-color: var(--color-gray-600); } -.dark .accordion dt button:focus, -.dark .accordion dt button:hover, -.dark .accordion dt button[aria-expanded="true"] { +.dark .accordion .descr-term button:focus, +.dark .accordion .descr-term button:hover, +.dark .accordion .descr-term button[aria-expanded="true"] { background: #00000060; } -.dark .accordion dt button:hover .accordion-icon::before, -.dark .accordion dt button:hover .accordion-icon::after { +.dark .accordion .descr-term button:hover .accordion-icon::before, +.dark .accordion .descr-term button:hover .accordion-icon::after { background: var(--color-gray-100); } -html[dir="rtl"] .accordion dt button { +html[dir="rtl"] .accordion .descr-term button { padding: var(--spacing-s) var(--spacing-xs) var(--spacing-s) var(--spacing-m); } -html[dir="rtl"] .accordion dt button::before { +html[dir="rtl"] .accordion .descr-term button::before { right: 0; } -.section[class*='-up'] dl.accordion { +.section[class*='-up'] .descr-list.accordion { max-width: unset; } diff --git a/libs/blocks/accordion/accordion.js b/libs/blocks/accordion/accordion.js index 2c1fced2e5..4992b7f061 100644 --- a/libs/blocks/accordion/accordion.js +++ b/libs/blocks/accordion/accordion.js @@ -64,7 +64,7 @@ function handleClick(el, dd, num) { } function defalutOpen(accordion) { - handleClick(accordion.querySelector('.accordion-trigger'), accordion.querySelector('dd'), 1, 0); + handleClick(accordion.querySelector('.accordion-trigger'), accordion.querySelector('.descr-details'), 1, 0); } function createItem(accordion, id, heading, num, edit) { @@ -87,10 +87,10 @@ function createItem(accordion, id, heading, num, edit) { const para = panel?.querySelector('p'); const text = para ? para.textContent : panel?.textContent; - const dtAttrs = hTag ? {} : { role: 'heading', 'aria-level': 3 }; + const dtAttrs = hTag ? { class: 'descr-term' } : { role: 'heading', 'aria-level': 3, class: 'descr-term' }; const dtHtml = hTag ? createTag(hTag.tagName, { class: 'accordion-heading' }, button) : button; - const dt = createTag('dt', dtAttrs, dtHtml); - const dd = createTag('dd', { 'aria-labelledby': triggerId, id: panelId, hidden: true }, panel); + const dt = createTag('div', dtAttrs, dtHtml); + const dd = createTag('div', { 'aria-labelledby': triggerId, id: panelId, hidden: true, class: 'descr-details' }, panel); const dm = createTag('div', { class: 'media-p' }); if (edit) { @@ -118,7 +118,7 @@ function populateMedia(accordion, id, num, collection) { export default function init(el) { const id = getUniqueId(el); - const accordion = createTag('dl', { class: 'accordion', id: `accordion-${id}`, role: 'presentation' }); + const accordion = createTag('div', { class: 'descr-list accordion', id: `accordion-${id}`, role: 'presentation' }); const accordionMedia = createTag('div', { class: 'accordion-media', id: `accordion-media-${id}` }); const isSeo = el.classList.contains('seo'); const isEditorial = el.classList.contains('editorial'); diff --git a/nala/blocks/accordion/accordion.page.js b/nala/blocks/accordion/accordion.page.js index 4d49b6fb94..98a9dd3707 100644 --- a/nala/blocks/accordion/accordion.page.js +++ b/nala/blocks/accordion/accordion.page.js @@ -5,8 +5,8 @@ export default class Accordion { this.section = this.page.locator('.section').nth(nth); this.accordion = this.page.locator('.accordion-container').nth(nth); this.accordionForeground = this.accordion.locator('.foreground'); - this.accordionHeaders = this.accordion.locator('dt[role=heading]'); - this.accordionButtons = this.accordion.locator('dt button'); + this.accordionHeaders = this.accordion.locator('.descr-term[role=heading]'); + this.accordionButtons = this.accordion.locator('.descr-term button'); this.accordionButtonIcons = this.accordion.locator('.accordion-icon'); this.outlineButton = this.accordion.locator('.con-button.outline').nth(nth); this.blueButton = this.accordion.locator('.con-button.blue').nth(nth); diff --git a/test/blocks/accordion/accordion.test.js b/test/blocks/accordion/accordion.test.js index 1c3eae799f..ee7e533f6e 100644 --- a/test/blocks/accordion/accordion.test.js +++ b/test/blocks/accordion/accordion.test.js @@ -18,7 +18,7 @@ describe('Accordion', () => { it('Renders with accordion class', async () => { document.head.innerHTML = await readFile({ path: './mocks/body.html' }); - const accordionDl = document.querySelector('dl.accordion'); + const accordionDl = document.querySelector('.descr-list.accordion'); expect(accordionDl).to.exist; }); @@ -31,7 +31,7 @@ describe('Accordion', () => { expect(script).to.exist; // handleClick() - const firstAccordionButton = document.body.querySelector('dt button'); + const firstAccordionButton = document.body.querySelector('.descr-term button'); expect(firstAccordionButton.getAttribute('aria-expanded')).to.equal('false'); expect(firstAccordionButton.getAttribute('daa-ll')).to.equal('open-1--What if my dough didn t rise'); firstAccordionButton.click(); diff --git a/test/blocks/accordion/editorial-accordion.test.js b/test/blocks/accordion/editorial-accordion.test.js index 8dd8b1a06a..0abb2771ba 100644 --- a/test/blocks/accordion/editorial-accordion.test.js +++ b/test/blocks/accordion/editorial-accordion.test.js @@ -17,13 +17,13 @@ describe('Accordion', () => { it('Load editorial body', async () => { document.head.innerHTML = await readFile({ path: './mocks/editorial-body.html' }); - const accordionDl = document.querySelector('dl.accordion'); + const accordionDl = document.querySelector('.descr-list.accordion'); expect(accordionDl).to.exist; }); it('Runs all basic functions of the accordion', async () => { // handleClick() - const firstAccordionButton = document.body.querySelector('dt button'); + const firstAccordionButton = document.body.querySelector('.descr-term button'); console.log('firstAccordionButton'); console.log(firstAccordionButton); expect(firstAccordionButton.getAttribute('aria-expanded')).to.equal('true'); From 366c63a86ad20cb93e8662e4107f9e7ede92efa4 Mon Sep 17 00:00:00 2001 From: Prince Patel Date: Fri, 7 Feb 2025 01:45:27 +0530 Subject: [PATCH 08/13] MWPW-165806 Visual heading text reading fix (#3616) * MWPW-165806 Visual heading text reading fix * add aria level --- libs/blocks/global-footer/global-footer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/blocks/global-footer/global-footer.js b/libs/blocks/global-footer/global-footer.js index e257c3d781..7818d81b4f 100644 --- a/libs/blocks/global-footer/global-footer.js +++ b/libs/blocks/global-footer/global-footer.js @@ -179,7 +179,7 @@ class Footer { if (placeholder && placeholder.length) { this.elements.featuredProducts - .append(toFragment`${placeholder}`); + .append(toFragment`${placeholder}`); } featuredProductsContent.querySelectorAll('.link-group').forEach((linkGroup) => { From 8d0f0d65b1760a22fceb10148e939f4d225a7601 Mon Sep 17 00:00:00 2001 From: Sheridan Sunier Date: Thu, 6 Feb 2025 12:15:34 -0800 Subject: [PATCH 09/13] MWPW-167205: [CAAS Authoring] Config Change for new Newsroom Card Style (#3631) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "MWPW-140452 - Icon authoring in milo using the federal repo a… (#3357) Revert "MWPW-140452 - Icon authoring in milo using the federal repo and individual SVG assets (#3259)" This reverts commit 81a5770cecc2a17f07efe5229c65b71d2dbb9bb4. * [Release] Stage to Main (#3497) MWPW-165774 [Mobile-GNAV] page is not scrollable in live page (#3495) * check for new nav when disabling ios scroll * shortened the check from the previous commit Co-authored-by: Raghav Sharma <118168183+sharmrj@users.noreply.github.com> * MWPW-163904: saving work --------- Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com> Co-authored-by: Okan Sahin <39759830+mokimo@users.noreply.github.com> Co-authored-by: Raghav Sharma <118168183+sharmrj@users.noreply.github.com> Co-authored-by: Sheridan Sunier --- libs/blocks/caas-config/caas-config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/blocks/caas-config/caas-config.js b/libs/blocks/caas-config/caas-config.js index 540841c741..c59b414597 100644 --- a/libs/blocks/caas-config/caas-config.js +++ b/libs/blocks/caas-config/caas-config.js @@ -76,6 +76,7 @@ const defaultOptions = { product: 'Product Card', 'text-card': 'Text Card', 'icon-card': 'Icon Card', + 'news-card': 'News Card', 'custom-card': 'Custom Card', }, collectionBtnStyle: { From 94faeaa2352af5867112c26ddea68fbcf8be8977 Mon Sep 17 00:00:00 2001 From: Jan Ivan Viloria <158211769+ivanvatadobe@users.noreply.github.com> Date: Thu, 6 Feb 2025 20:08:49 -0500 Subject: [PATCH 10/13] MWPW-167066 [MEP] Add capabilty for merch-card-collection block to run MEP commands (#3623) * first commit * add unit test --- .../merch-card-collection.js | 10 +++++- .../merch-card-collection.test.js | 33 ++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/libs/blocks/merch-card-collection/merch-card-collection.js b/libs/blocks/merch-card-collection/merch-card-collection.js index c7311b6a98..906bd6df46 100644 --- a/libs/blocks/merch-card-collection/merch-card-collection.js +++ b/libs/blocks/merch-card-collection/merch-card-collection.js @@ -43,7 +43,15 @@ const fail = (el, err = '') => { /** Parse and prepare cards */ async function getCardsRoot(config, html) { - const cards = `
${html}
`; + let cards = `
${html}
`; + const { mep, placeholders } = config; + if (mep?.commands?.length) { + const mepRoot = createTag('div', {}, cards); + const { handleCommands, replacePlaceholders } = await import('../../features/personalization/personalization.js'); + handleCommands(mep?.commands, mepRoot, false, true); + if (placeholders) mepRoot.innerHTML = replacePlaceholders(mepRoot.innerHTML, placeholders); + cards = mepRoot.innerHTML; + } const fragment = document.createRange().createContextualFragment( await replaceText(cards, config), ); diff --git a/test/blocks/merch-card-collection/merch-card-collection.test.js b/test/blocks/merch-card-collection/merch-card-collection.test.js index f544de37db..e70d4513fc 100644 --- a/test/blocks/merch-card-collection/merch-card-collection.test.js +++ b/test/blocks/merch-card-collection/merch-card-collection.test.js @@ -171,7 +171,7 @@ describe('Merch Cards', async () => { expect(merchCards.outerHTML).to.equal(merchCards.nextElementSibling.outerHTML); }); - it('should override cards when asked to', async () => { + it('MEP: should override cards when asked to', async () => { const el = document.getElementById('multipleFilters'); setConfig({ ...conf, @@ -207,6 +207,37 @@ describe('Merch Cards', async () => { expect(merchCards.dataset.overrides).to.equal('promo1.json:/override-photoshop,promo2.json:/override-express'); }); + it('MEP: should modify cards when asked to', async () => { + const el = document.getElementById('multipleFilters'); + setConfig({ + ...conf, + mep: { + preview: true, + commands: [ + { + action: 'remove', + selector: 'merch-card h3 #_include-fragments #_all', + pageFilter: '', + content: 'true', + selectorType: 'other', + manifestId: 'merchcardupdates.json', + targetManifestId: false, + modifiers: [ + 'include-fragments', + 'all', + ], + }, + ], + }, + }); + cards = [...document.querySelectorAll('#cards .merch-card')] + .map((merchCardEl) => ({ cardContent: merchCardEl.outerHTML })); // mock cards + const merchCards = await init(el); + expect(merchCards.filter).to.equal('all'); + await delay(500); + expect(merchCards.querySelectorAll('h3[data-removed-manifest-id]').length).to.equal(4); + }); + it('should localize the query-index url', async () => { setConfig({ ...conf, From 5c4ed083c62d709b5799dc6e9e9bdaa138387d08 Mon Sep 17 00:00:00 2001 From: Cody Lloyd <119891065+colloyd@users.noreply.github.com> Date: Fri, 7 Feb 2025 03:02:09 -0700 Subject: [PATCH 11/13] quiz-entry block removal (#3608) * quiz-entry block removal * deletes the quiz-entry block Resolves: [MWPW-166952](https://jira.corp.adobe.com/browse/MWPW-166952) * removed quiz-entry unit tests * quiz-entry removed from codeowners --- CODEOWNERS | 1 - libs/blocks/quiz-entry/mlField.js | 52 - libs/blocks/quiz-entry/quiz-entry.css | 489 ----- libs/blocks/quiz-entry/quiz-entry.js | 437 ---- libs/blocks/quiz-entry/quizPopover.js | 31 - libs/blocks/quiz-entry/quizoption.js | 184 -- libs/blocks/quiz-entry/utils.js | 122 -- test/blocks/quiz-entry/mocks/index.html | 22 - .../mocks/invalid-user-selection.json | 8 - test/blocks/quiz-entry/mocks/mock-data.js | 1876 ----------------- test/blocks/quiz-entry/mocks/mock-states.js | 139 -- test/blocks/quiz-entry/mocks/questions.json | 529 ----- test/blocks/quiz-entry/mocks/quiz.html | 24 - .../quiz-entry/mocks/result-resources.json | 207 -- test/blocks/quiz-entry/mocks/results.json | 777 ------- test/blocks/quiz-entry/mocks/strings.json | 506 ----- test/blocks/quiz-entry/quiz-entry.test.js | 314 --- test/blocks/quiz-entry/utils.test.js | 248 --- 18 files changed, 5966 deletions(-) delete mode 100644 libs/blocks/quiz-entry/mlField.js delete mode 100644 libs/blocks/quiz-entry/quiz-entry.css delete mode 100644 libs/blocks/quiz-entry/quiz-entry.js delete mode 100644 libs/blocks/quiz-entry/quizPopover.js delete mode 100644 libs/blocks/quiz-entry/quizoption.js delete mode 100644 libs/blocks/quiz-entry/utils.js delete mode 100644 test/blocks/quiz-entry/mocks/index.html delete mode 100644 test/blocks/quiz-entry/mocks/invalid-user-selection.json delete mode 100644 test/blocks/quiz-entry/mocks/mock-data.js delete mode 100644 test/blocks/quiz-entry/mocks/mock-states.js delete mode 100644 test/blocks/quiz-entry/mocks/questions.json delete mode 100644 test/blocks/quiz-entry/mocks/quiz.html delete mode 100644 test/blocks/quiz-entry/mocks/result-resources.json delete mode 100644 test/blocks/quiz-entry/mocks/results.json delete mode 100644 test/blocks/quiz-entry/mocks/strings.json delete mode 100644 test/blocks/quiz-entry/quiz-entry.test.js delete mode 100644 test/blocks/quiz-entry/utils.test.js diff --git a/CODEOWNERS b/CODEOWNERS index d4fea27718..8b8bdc024b 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -41,7 +41,6 @@ /libs/blocks/ost/ @adobecom/tacocat /libs/blocks/pdf-vewer/ @meganthecoder @JasonHowellSlavin @Brandon32 /libs/blocks/quiz/ @colloyd @sabyamon @fullcolorcoder @JackySun9 -/libs/blocks/quiz-entry/ @colloyd @fullcolorcoder @JackySun9 /libs/blocks/quiz-marquee/ @ryanmparrish /libs/blocks/quiz-results/ @colloyd @sabyamon @fullcolorcoder @JackySun9 /libs/blocks/quote/ @ryanmparrish diff --git a/libs/blocks/quiz-entry/mlField.js b/libs/blocks/quiz-entry/mlField.js deleted file mode 100644 index 17b9f72fc9..0000000000 --- a/libs/blocks/quiz-entry/mlField.js +++ /dev/null @@ -1,52 +0,0 @@ -import { html } from '../../deps/htm-preact.js'; -import { getConfig } from '../../utils/utils.js'; - -export const getMLResults = async (endpoint, apiKey, threshold, input, count, validFiCodes) => { - const { env } = getConfig(); - const subdomain = env === 'prod' ? 'cchome' : 'cchome-dev'; - const apiUrl = `https://${subdomain}.adobe.io/int/v1/models`; - const params = { - endpoint, - contentType: 'application/json', - payload: { - data: { - input, - num_items: count || 10, - given_prod_list: validFiCodes, - }, - }, - }; - - const result = await fetch(apiUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'x-api-key': apiKey, - }, - body: JSON.stringify(params), - }) - .then((response) => response.json()) - .catch((error) => window.lana.log(`ERROR: Fetching fi codes ${error}`, { tags: 'quiz-entry', errorType: 'i' })); - - let value; - let highestProb = null; - if (result) { - result.filtered = result?.data?.filter((item) => { - let isValid = false; - if (!highestProb) { - highestProb = item.prob; - isValid = true; - } else if (item.prob / highestProb > threshold) { - isValid = true; - } - return isValid; - }); - value = result; - } else { - value = { errors: [{ title: 'Unable to fetch fi codes' }] }; - } - return value; -}; - -export const mlField = ({ cardsUsed, onMLInput, onMLEnter, placeholderText, onClearClick }) => html` - `; diff --git a/libs/blocks/quiz-entry/quiz-entry.css b/libs/blocks/quiz-entry/quiz-entry.css deleted file mode 100644 index a64b8ad7e9..0000000000 --- a/libs/blocks/quiz-entry/quiz-entry.css +++ /dev/null @@ -1,489 +0,0 @@ -.quiz-entry { - --quiz-button-disabled-bg: #757575; - --quiz-button-disabled-text: #FFF; -} - -.quiz-container { - align-items: center; - color: var(--color-black); - display: flex; - flex-direction: column; - padding: var(--spacing-xxxl) var(--spacing-xl); -} - -.quiz-container *{ - box-sizing: border-box; -} - -.quiz-heading-container { - color: #2C2C2C; - margin-bottom: var(--spacing-m); - text-align: center; -} - -.quiz-title { - font-size: var(--type-heading-xl-size); - line-height: var(--type-heading-xl-lh); - font-weight: var(--type-heading-all-weight); - margin: 0 0 8px; -} - -.quiz-subtitle { - font-size: var(--type-heading-l-size); - line-height: var(--type-heading-l-lh); - margin: 0; -} - -.quiz-question-container { - display: flex; - flex-flow: row wrap; - justify-content: center; - margin-bottom: var(--spacing-xl); - max-width: 1130px; - width: 100%; -} - -.quiz-input-container { - display: flex; - flex-flow:row nowrap; - justify-content: center; - max-width: 480px; - position: relative; - width: 100%; -} - -.quiz-input { - background: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url%28%23clip0_796_4337%29%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.77%2014.7094L11.2357%2010.1751C12.1742%208.96682%2012.6169%207.44625%2012.4736%205.92302C12.3304%204.39978%2011.6119%202.98841%2010.4646%201.97626C9.31732%200.964113%207.82737%200.427296%206.29816%200.475108C4.76895%200.52292%203.31545%201.15177%202.23361%202.23361C1.15177%203.31545%200.52292%204.76895%200.475108%206.29816C0.427296%207.82737%200.964113%209.31732%201.97626%2010.4646C2.98841%2011.6119%204.39978%2012.3304%205.92302%2012.4736C7.44625%2012.6169%208.96682%2012.1742%2010.1751%2011.2357L14.7094%2015.77C14.85%2015.9107%2015.0408%2015.9897%2015.2397%2015.9897C15.4386%2015.9897%2015.6293%2015.9107%2015.77%2015.77C15.9106%2015.6294%2015.9896%2015.4386%2015.9896%2015.2397C15.9896%2015.0408%2015.9106%2014.8501%2015.77%2014.7094ZM6.49998%2011C5.60997%2011%204.73994%2010.7361%203.99992%2010.2416C3.2599%209.74716%202.68312%209.04436%202.34253%208.22209C2.00193%207.39982%201.91282%206.49502%202.08645%205.62211C2.26008%204.74919%202.68867%203.94737%203.318%203.31803C3.94734%202.6887%204.74916%202.26011%205.62208%202.08648C6.49499%201.91285%207.39979%202.00196%208.22206%202.34256C9.04433%202.68315%209.74713%203.25993%2010.2416%203.99995C10.7361%204.73997%2011%205.61%2011%206.50001C10.9986%207.69308%2010.5241%208.83689%209.68048%209.68051C8.83686%2010.5241%207.69305%2010.9987%206.49998%2011Z%22%20fill%3D%22%23222222%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_796_4337%22%3E%0A%3Crect%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22white%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E") no-repeat #fff; - background-position: center right 24px; - border: 2px solid #e6e6e6; - border-radius: 40px; - color: var(--text-color); - cursor: pointer; - font-size: var( --type-body-s-size); - height: 56px; - line-height: var(--type-heading-m-lh); - padding: 0 var(--spacing-xxl) 0 var(--spacing-s); - width: 100%; -} - -.quiz-input::placeholder { - color: var(--text-color); - font-size: var( --type-body-s-size) !important; - font-style: italic; -} - -.quiz-input:focus-visible { - outline: 4px solid #4B75FF; - outline-offset:-1px; -} - -.quiz-input:disabled { - background-color: #fafafacc; - cursor: not-allowed; - outline: none; - opacity: 0.5; -} - -.quiz-input-clear { - background: url("data:image/svg+xml,%0A%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect id='Frame' x='4.14' y='3.77' width='12' height='12' style='fill:red;fill-opacity:0'/%3E%3Cg id='Line'%3E%3Cpath d='M14.88,13.16a1,1,0,0,1,0,1.35,1,1,0,0,1-.67.27.94.94,0,0,1-.67-.27l-3.4-3.4-3.39,3.4a1,1,0,0,1-1.35,0,1,1,0,0,1,0-1.35L8.8,9.77,5.4,6.37A1,1,0,0,1,5.4,5,1,1,0,0,1,6.75,5l3.39,3.39L13.54,5a.95.95,0,1,1,1.34,1.34l-3.39,3.4Z' style='fill:%236e6e6e'/%3E%3C/g%3E%3C/svg%3E") center no-repeat #fff; - background-size: 50%; - border-radius: 50%; - cursor: pointer; - height: 52px; - position: absolute; - right: 8px; - top: 50%; - transform: translateY(-50%); - width: 52px; -} - -.quiz-input-clear.hidden { - display: none; -} - -.popover-container { - left: 50%; - position: absolute; - transform: translateX(-50%); - width: 100%; - z-index: 10; -} - -.popover-container.popover-bottom { - top: 100%; -} - -.popover-content { - background-color: var(--color-white); - padding: 20px; - max-height: 404px; - overflow: hidden; - text-align: left; - border-radius: 4px; - border: 2px solid #E6E6E6; - margin-top: 8px; - box-sizing: border-box; -} - -.popover-content div:hover { - background-color: #f0f0f0; /* Highlight color on hover */ - text-decoration: underline; -} - -.popover-item { - cursor: pointer; - font-size: var(--type-detail-l-size); - font-weight: 400; - line-height: var(--type-heading-s-lh); - color: var(--link-color-dark); -} - -.quiz-directions { - align-items: center; - background: linear-gradient(90deg, #A900A2 1.24%, #E84601 100%); - border-radius: 8px; - color: #FFF; - display: flex; - font-size: 17px; - font-weight: 900; - height: 40px; - justify-content: center; - line-height: 30px; - margin: var(--spacing-m) 0 8px; - width: 100%; -} - -.quiz-options-container { - display: flex; - flex-flow: row wrap; - position: relative; - max-width: 320px; - width: 100%; -} - -.quiz-options-container:focus-visible { - outline: 4px solid #4B75FF; - outline-offset: 2px; -} - -.carousel-slides { - display: flex; - gap: 8px; - justify-content: center; - overflow: hidden; - padding: 8px; - position: relative; - width: 100%; -} - -.carousel-arrow { - background-color: #fff; -background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill%3A%23f0f%3Bopacity%3A0%3B%7D.b%7Bfill%3A%23767676%3B%7D%3C/style%3E%3C/defs%3E%3Cg transform='translate(10 16) rotate(180)'%3E%3Crect class='a' width='10' height='16'/%3E%3Cpath class='b' d='M9.115,13.853l0,0L3.051,8,9.117,2.15l0,0A1.246,1.246,0,1,0,7.386.353l0,0L7.367.366h0L.382,7.1l0,0a1.237,1.237,0,0,0,0,1.794l0,0,6.982,6.732,0,0,.015.014,0,0a1.246,1.246,0,1,0,1.73-1.794Z'/%3E%3C/g%3E%3C/svg%3E"); - background-size: 15px; - background-position: 50% 50%; - background-repeat: no-repeat; - border: none; - border-radius: 50%; - box-shadow: 10px 10px 15px -5px rgba(0 0 0 /23%); - cursor: pointer; - height: 63px; - position: absolute; - top: 50%; - transform: translateY(-50%); - width: 63px; - z-index: 1; -} - -.arrow-next { - right: -32px; -} - -.arrow-prev { - left: -32px; - transform: rotate(180deg) translateY(50%); -} - -.arrow-next.rtl { - transform: rotate(180deg) translateY(50%); - -} - -.arrow-prev.rtl { - transform: rotate(0deg) translateY(-50%); -} - -.quiz-options-container:focus-visible, -.carousel-arrow:focus-visible { - outline: 4px solid #4B75FF; - outline-offset: -1px; -} - -.quiz-option { - flex: 0 0 138px; - flex-direction: column; - height: 100%; - margin: 0; - align-items: stretch; - border: none; - border-radius: 0.5rem; - cursor: pointer; - display: flex; - font-family: inherit; - padding: 0; - user-select: none; - min-height: 186px; - outline: none; - position: relative; -} - -.quiz-option-image { - display: flex; - align-items: center; - border-radius: 0.5rem; - justify-content: center; - margin: 0; - height: 100%; - filter: brightness(35%); -} - -.quiz-option-text-container { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - justify-content: center; - padding: 0 1rem; -} - -.quiz-option-title { - color: white; - font-size: var(--type-detail-l-size); - font-weight: 900; - line-height: var(--type-heading-s-lh); - margin: 0 0 4px; - text-align: start; -} - -.quiz-option-text { - color: white; - font-size: 14px; - font-weight: 400; - line-height: 21px; - margin: 0; - text-align: start; -} - -.quiz-option.selected { - border: 5px solid #FC00F2; - border-radius: 13px; -} - -.quiz-option.selected::before { - background: url("data:image/svg+xml,%3Csvg%20width%3D%2225%22%20height%3D%224%22%20viewBox%3D%220%200%2025%204%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M2%202H23%22%20stroke%3D%22white%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E") no-repeat; - background-size: 20px 4px; - content: " "; - height: 4px; - position: absolute; - right: 20px; - top: 20px; - width: 20px; - z-index: 1; -} - -.quiz-option:hover .quiz-option-image, -.quiz-option.selected .quiz-option-image, -.quiz-option:focus-visible .quiz-option-image { - filter: brightness(20%); -} - -.quiz-option:focus-visible::after { - content: " "; - border-radius: 0.5rem; - height: 100%; - outline: 4px solid #4B75FF; - outline-offset: 2px; - position: absolute; - width: 100%; - z-index: -1; -} - -.quiz-option.selected:focus-visible::after { - border-radius: 8px; - outline-offset: 8px; -} - -.quiz-option.disabled { - background-color: #fafafacc; - outline: none; -} - -.quiz-option.disabled .quiz-option-icon, -.quiz-option.disabled .quiz-option-image, -.quiz-option.disabled .quiz-option-text-container{ - opacity: 0.5; - cursor: not-allowed; -} - -.quiz-button-container { - align-items: center; - display: flex; - justify-content: center; -} - -.quiz-button { - background: var(--color-gray-800); - border: 2px solid var(--color-white); - border-radius: 20px; - cursor: pointer; - font-family: inherit; - font-size: 17px; - font-weight: 700; - line-height: 21px; - padding: 9px 16px; -} - -.quiz-button:focus-visible { - outline: 4px solid #4B75FF; -} - -.quiz-button-label { - color: var(--color-white); - font-size: 18px; - font-weight: var(--type-heading-all-weight); - line-height: 22px; -} - -.quiz-button[disabled] { - background: var(--quiz-button-disabled-bg); - cursor: not-allowed; -} - -.quiz-button[disabled] .quiz-button-label{ - color: var(--quiz-button-disabled-text); -} - -/* Tablet up */ -@media screen and (min-width: 600px) { - .quiz-container { - padding: 80px 64px; - } - - .quiz-input { - height: 66px; - } - - .quiz-input::placeholder { - width: 311px; - height: 30px; - font-size: 20px; - line-height: 30px; - } - - .quiz-options-container { - max-width: none; - } - - .carousel-slides { - justify-content: left; - } - - .carousel-slides.align-right { - justify-content: right; - margin-left: 0; - } - - .quiz-option-icon { - border-radius: 0.5rem; - justify-content: center; - min-height: 126px; - } - - .quiz-option-icon img { - height: var(--icon-size-xl); - width: var(--icon-size-xl); - max-width: 100%; - } - - .quiz-option.has-icon.quiz-option.has-image .no-icon-tablet, - .quiz-option.has-icon .quiz-option-image { - display: none; - } - - .quiz-option.has-icon .no-icon-tablet ~ .quiz-option-image, - .quiz-option.has-icon .no-icon-default { - display: flex; - } - - .quiz-option.selected .quiz-option-text { - font-weight: normal; - } - - .quiz-footer { - margin: 0 0 40px; - } -} - -/* Desktop */ -@media screen and (min-width: 1024px) { - .quiz-container { - padding: 104px 64px; - } - - .quiz-directions { - height: 50px; - } - - .carousel-slides { - justify-content: left; - margin: 0 -8px; - width: calc(100% + 8px); - } - - .carousel-slides.align-right { - justify-content: right; - margin-left: 0; - } - - .quiz-option { - flex: 0 0 232px; - min-height: 232px; - } - - .quiz-option-title { - font-size: 24px; - line-height: 30px; - text-align: center; - } - - .quiz-option-text { - display: none; - text-align: center; - font-size: var(--type-detail-l-size); - line-height: var(--type-heading-s-lh); - } - - .quiz-option:hover .quiz-option-text, - .quiz-option.selected .quiz-option-text , - .quiz-option:focus-visible .quiz-option-text { - display: block; - } - - .quiz-option.has-image .quiz-option-icon { - display: none; - } - - .quiz-option.has-icon .quiz-option-image { - display: flex; - } - - .quiz-step-container.top { - display: flex; - } - - .quiz-step-container.bottom { - display: none; - } -} diff --git a/libs/blocks/quiz-entry/quiz-entry.js b/libs/blocks/quiz-entry/quiz-entry.js deleted file mode 100644 index 5ffecb10ed..0000000000 --- a/libs/blocks/quiz-entry/quiz-entry.js +++ /dev/null @@ -1,437 +0,0 @@ -import { render, html, useEffect, useState, useRef } from '../../deps/htm-preact.js'; -import { getQuizEntryData, handleNext, handleSelections } from './utils.js'; -import { mlField, getMLResults } from './mlField.js'; -import { GetQuizOption } from './quizoption.js'; -import { quizPopover, getSuggestions } from './quizPopover.js'; -import { getConfig } from '../../utils/utils.js'; - -export const locationWrapper = { - redirect: (url) => { - window.location = url; - }, -}; - -const App = ({ - quizPath, - maxQuestions, - analyticsType = null, - questionData = { questions: { data: [] } }, - stringsData = { questions: { data: [] } }, - resultsData = {}, - debug = false, -}) => { - const [dataLoaded, setDataLoaded] = useState(false); - const [quizState, setQuizState] = useState({ userFlow: [], userSelection: [], results: {} }); - const [quizLists, setQuizLists] = useState({}); - const [quizData, setQuizData] = useState({}); - const [hasMLData, setHasMLData] = useState(false); - const [mlData, setMLData] = useState({}); - const [mlInputUsed, setMLInputUsed] = useState(false); - const [cardsUsed, setCardsUsed] = useState(false); - const [selectedQuestion, setSelectedQuestion] = useState(null); - const [selectedCards, setSelectedCards] = useState({}); - const questionCount = useRef(0); - const [btnAnalytics, setBtnAnalytics] = useState(null); - const [showPopover, setShowPopover] = useState(false); - const [suggestions, setSuggestions] = useState([]); - - const QUIZ_INPUT = '#quiz-input'; - const QUIZ_INPUT_CLEAR = '#quiz-input-clear'; - const fiCodeCount = 3; - const enterKeyCode = 13; - const defaultThreshold = 0; - - let maxSelections = 10; - - const getStringValue = (propName) => { - if (!selectedQuestion?.questions) return ''; - const question = quizLists.strings[selectedQuestion.questions]; - return question?.[propName] || ''; - }; - - const getOptionsValue = (optionsType, prop) => { - const optionItem = quizData.strings[selectedQuestion.questions].data.find( - (item) => item.options === optionsType, - ); - return optionItem && optionItem[prop] ? optionItem[prop] : ''; - }; - - const sendMLFieldAnalytics = (input, isFieldText = true) => { - let val = ''; - - if (isFieldText) { - val = `Filters|${analyticsType}|${input}`; - } else if (input.length > 0) { - const fiCodes = input.map((result) => result.ficode); - val = `Filters|${analyticsType}|${selectedQuestion?.questions}/interest-${fiCodes.join('-')}`; - } - - const eventData = { - xdm: { - eventType: 'web.webinteraction.linkClicks', - web: { - webInteraction: { - linkClicks: { value: 1 }, - type: 'other', - name: val, - }, - }, - }, - data: { - _adobe_corpnew: { - digitalData: { - search: isFieldText ? { searchInfo: { keyword: val } } : undefined, - primaryEvent: !isFieldText ? { eventInfo: { eventName: val } } : undefined, - }, - }, - }, - }; - - // eslint-disable-next-line no-underscore-dangle - window._satellite?.track('event', eventData); - }; - - useEffect(() => { - (async () => { - const qMap = {}; - const questionDataArray = questionData?.questions?.data || []; - questionDataArray.forEach((question) => { - qMap[question.questions] = question; - }); - - const strMap = {}; - const stringsDataArray = stringsData?.questions?.data || []; - stringsDataArray.forEach((question) => { - strMap[question.q] = question; - }); - - const qLists = { - questions: qMap, - strings: strMap, - }; - - const qData = { - questions: questionData, - strings: stringsData, - }; - - if (questionDataArray.length > 0) { - setQuizState({ - userFlow: [questionDataArray[0].questions], - userSelection: quizState.userSelection, - results: resultsData, - }); - setSelectedQuestion(qLists.questions[questionDataArray[0].questions]); - } - setQuizData(qData); - setQuizLists(qLists); - setDataLoaded(true); - })(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - useEffect(() => { - (async () => { - const selectedTotal = Object.keys(selectedCards).length; - if (selectedTotal > 0) { - setCardsUsed(true); - } else { - setCardsUsed(false); - } - })(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [selectedCards]); - - useEffect(() => { - (async () => { - if (quizState.userFlow && quizState.userFlow.length) { - const currentFlow = [...quizState.userFlow]; - if (currentFlow && currentFlow.length && questionCount.current < maxQuestions) { - quizState.userFlow.shift(); - questionCount.current += 1; - setSelectedQuestion(quizLists.questions[currentFlow.shift()] || []); - } - } - })(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [quizState]); - - useEffect(() => { - (async () => { - if (selectedQuestion) { - const mlmap = { mlDetails: {}, mlOptions: [], mlValues: [] }; - quizData.questions[selectedQuestion.questions].data.forEach((row) => { - if (row.type === 'form') { - mlmap.mlDetails = row; - } else if (row.type === 'api_return_code') { - mlmap.mlOptions.push(row); - mlmap.mlValues.push(row.options); - } - }); - setMLData(mlmap); - if (Object.keys(mlmap.mlDetails).length > 0) { - setHasMLData(true); - } else { - setHasMLData(false); - } - } - })(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [selectedQuestion]); - - useEffect(() => { - let btnAnalyticsData = ''; - const selectedCardNames = Object.keys(selectedCards); - if (selectedCardNames.length > 0) { - btnAnalyticsData = `Filters|${analyticsType}|${selectedQuestion?.questions}/${selectedCardNames.join('/')}`; - } - - setBtnAnalytics(btnAnalyticsData); - }, [selectedQuestion, selectedCards, analyticsType]); - - const continueQuiz = async () => { - let selections = {}; - let userFlow = []; - if (mlInputUsed) { - const { mlDetails, mlValues } = mlData; - const mlFieldText = document.querySelector(QUIZ_INPUT).value; - const fiResults = await getMLResults(mlDetails.endpoint, mlDetails['api-key'], mlDetails.threshold || defaultThreshold, mlFieldText, fiCodeCount, mlValues); - const { filtered } = fiResults; - let fallback = []; - let error = 'Cannot connect to the ML endpoint'; - - if (mlDetails.fallback) fallback = mlDetails.fallback.split(','); - if (filtered) { - filtered.forEach((item) => { - selections[item.ficode] = true; - }); - - sendMLFieldAnalytics(filtered, false); - } else if (fiResults.errors || fiResults.error_code) { - for (const ficode of fallback) { - selections[ficode] = true; - } - if (fiResults.errors) error = fiResults.errors[0].title; - if (fiResults.error_code) error = fiResults.message; - window.lana.log(`ML results error - ${error}`, { tags: 'quiz-entry', errorType: 'i' }); - sendMLFieldAnalytics(fallback, false); - } - - sendMLFieldAnalytics(mlFieldText, true); - - if (debug) { - let fiCodes = []; - if (!fiResults.errors && !fiResults.error_code) { - // eslint-disable-next-line no-console - console.log('all', fiResults.data); - // eslint-disable-next-line no-console - console.log('filtered', filtered); - - fiCodes = filtered.map((result) => result.ficode); - } else { - // eslint-disable-next-line no-console - console.log('fallback codes used', fallback); - fiCodes = fallback.map((result) => result.ficode); - } - // eslint-disable-next-line no-console - console.log('sending ML field text to Adobe Analytics: ', `Filters|${analyticsType}|${mlFieldText}`); - // eslint-disable-next-line no-console - console.log('sending ML field fiCodes to Adobe Analytics: ', `Filters|${analyticsType}|${selectedQuestion?.questions}/interest-${fiCodes.join('-')}`); - } - } - - if (cardsUsed) { - userFlow = quizState.userFlow; - selections = selectedCards; - } - - if (Object.keys(selections).length > 0) { - const { nextFlow } = handleNext( - questionData, - selectedQuestion, - selections, - userFlow, - ); - const { nextSelections } = handleSelections( - quizState.userSelection, - selectedQuestion, - selections, - ); - - if (mlInputUsed) { nextSelections[0].isML = true; } - - const currentQuizState = { - userFlow: nextFlow, - userSelection: nextSelections, - results: resultsData, - }; - localStorage.setItem('stored-quiz-state', JSON.stringify(currentQuizState)); - setQuizState(currentQuizState); - - // eslint-disable-next-line no-console - if (debug) console.log(currentQuizState); - if (questionCount.current === maxQuestions || currentQuizState.userFlow.length === 1) { - if (!debug) { - locationWrapper.redirect(quizPath); - } - } else { - setSelectedCards({}); - setSelectedQuestion(null); - setMLInputUsed(false); - } - } - }; - - const onOptionClick = (option) => () => { - const selected = { ...selectedCards }; - const selectedTotal = Object.keys(selected).length; - - if (selectedTotal >= maxSelections && !selected[option.options]) { - return; - } - - if (!selected[option.options]) { - selected[option.options] = true; - } else { - delete selected[option.options]; - } - - setSelectedCards(selected); - }; - - const onMLInput = async (event) => { - const inputValue = event.target.value; - setMLInputUsed(true); - const { mlDetails } = mlData; - const data = await getSuggestions(mlDetails['ac-endpoint'], mlDetails['ac-client-id'], inputValue, mlDetails['ac-scope']); - if (data && data.suggested_completions && data.suggested_completions.length > 0) { - setSuggestions(data.suggested_completions.slice(0, 5)); - setShowPopover(true); - } - - document.querySelector(QUIZ_INPUT_CLEAR).classList.toggle('hidden', !inputValue.length); - - if (inputValue.length === 0) { - setMLInputUsed(false); - setSuggestions([]); - setShowPopover(false); - } - }; - - const onMLEnter = (event) => { - if (event.keyCode === enterKeyCode) continueQuiz(); - }; - - const onSuggestionClick = (suggestion) => () => { - const input = document.querySelector(QUIZ_INPUT); - input.value = suggestion.name; - setSuggestions([]); - setShowPopover(false); - input.focus(); - }; - - const onClearClick = () => { - document.querySelector(QUIZ_INPUT).value = ''; - document.querySelector(QUIZ_INPUT_CLEAR).classList.add('hidden'); - setMLInputUsed(false); - setSuggestions([]); - setShowPopover(false); - }; - - if (selectedQuestion) { - maxSelections = +selectedQuestion['max-selections']; - } - - if (!dataLoaded || !selectedQuestion) return null; - - const { locale } = getConfig(); - return html`
-
-

${quizLists.strings[selectedQuestion.questions].heading}

-

${quizLists.strings[selectedQuestion.questions]['sub-head']}

-
-
-
- ${hasMLData && html` - <${mlField} - cardsUsed="${cardsUsed}" - onMLInput="${onMLInput}" - onMLEnter="${onMLEnter}" - onClearClick="${onClearClick}" - placeholderText="${getOptionsValue('fi_code', 'title')}"/>`} - ${showPopover && html`<${quizPopover} - suggestions=${suggestions} - position="bottom" - onSuggestionClick=${onSuggestionClick}/>`} -
-
${quizLists.strings[selectedQuestion.questions].text}
- ${selectedQuestion.questions && html`<${GetQuizOption} - maxSelections=${maxSelections} - options=${quizData.strings[selectedQuestion.questions]} - background=${getStringValue('icon-background-color')} - countSelectedCards=${Object.keys(selectedCards).length} - selectedCards=${selectedCards} - onOptionClick=${onOptionClick} - getOptionsValue=${getOptionsValue} - mlInputUsed=${mlInputUsed}/>`} -
-
- -
-
`; -}; -export default async function init( - el, - config = { - quizPath: null, - maxQuestions: null, - analyticsType: null, - questionData: null, - stringsData: null, - resultsData: null, - debug: false, - }, -) { - let quizEntry; - if (config.questionData && config.stringsData) { - quizEntry = config; - } else { - try { - quizEntry = await getQuizEntryData(el); - } catch (error) { - // eslint-disable-next-line no-console - console.error('Failed to load quiz data:', error); - quizEntry = { - quizPath: '', - maxQuestions: 0, - analyticsType: '', - questionData: { questions: { data: [] } }, - stringsData: { questions: { data: [] } }, - resultsData: {}, - debug: false, - }; - } - } - - const params = new URL(document.location).searchParams; - const isDebug = params.get('debug') === 'quiz-entry'; - quizEntry.debug = isDebug; - - el.replaceChildren(); - render(html`<${App} - quizPath=${quizEntry.quizPath || ''} - maxQuestions=${quizEntry.maxQuestions || 0} - analyticsType=${quizEntry.analyticsType || ''} - questionData=${quizEntry.questionData} - stringsData=${quizEntry.stringsData} - resultsData=${quizEntry.resultsData} - debug=${quizEntry.debug || false} - />`, el); -} diff --git a/libs/blocks/quiz-entry/quizPopover.js b/libs/blocks/quiz-entry/quizPopover.js deleted file mode 100644 index ed0edbe212..0000000000 --- a/libs/blocks/quiz-entry/quizPopover.js +++ /dev/null @@ -1,31 +0,0 @@ -import { html } from '../../deps/htm-preact.js'; -import { getConfig } from '../../utils/utils.js'; - -export const getSuggestions = async (endpoint, clientId, input, scope) => { - const { locale } = getConfig(); - const localeCode = locale?.ietf ? `${locale.ietf}`.replace('-', '_') : 'en_us'; - const apiUrl = `https://adobesearch.adobe.io/${endpoint}/completions?q[text]=${input}&q[locale]=${localeCode}&scope=${scope}`; - - const response = await fetch(apiUrl, { - method: 'GET', - headers: { 'x-api-key': clientId }, - }); - - if (!response.ok) { - window.lana.log('Failed to fetch suggestions', { tags: 'quiz-entry', errorType: 'i' }); - return ''; - } - - const data = await response.json(); - return data; -}; - -export const quizPopover = ({ suggestions, position = 'bottom', onSuggestionClick }) => html`
-
- ${suggestions.map((suggestion, index) => html` -
- ${suggestion.name} -
- `)} -
-
`; diff --git a/libs/blocks/quiz-entry/quizoption.js b/libs/blocks/quiz-entry/quizoption.js deleted file mode 100644 index 634d00d6f5..0000000000 --- a/libs/blocks/quiz-entry/quizoption.js +++ /dev/null @@ -1,184 +0,0 @@ -import { html, useState, useEffect } from '../../deps/htm-preact.js'; -import { getSwipeDistance, getSwipeDirection } from '../carousel/carousel.js'; -import { createTag } from '../../utils/utils.js'; -import { removeLeftToRightMark } from '../quiz/utils.js'; - -export const OptionCard = ({ - text, title, image, icon, iconTablet, iconDesktop, options, - disabled, selected, background, onClick, -}) => { - const getOptionClass = () => { - let className = 'no-track '; - if (icon || iconTablet || iconDesktop) className += 'has-icon '; - if (image) className += 'has-image '; - if (background) className += 'has-background '; - if (disabled) className += 'disabled '; - if (selected) className += 'selected '; - return className; - }; - - const getIconHtml = () => html`
- - ${iconDesktop && html``} - ${iconTablet && html``} - - -
`; - - const imageHtml = image ? html`
` : null; - const titleHtml = title ? html`

${title}

` : null; - const textHtml = text ? html`

${text}

` : null; - - return html``; -}; - -export const GetQuizOption = ({ - options, maxSelections, selectedCards, - onOptionClick, countSelectedCards, getOptionsValue, - background, mlInputUsed, -}) => { - const [index, setIndex] = useState(0); - const [visibleCount, setVisibleCount] = useState(6); - const [slideWidth, setSlideWidth] = useState(0); - - setVisibleCount(window.innerWidth >= 600 ? 6 : 3); - - const isRTL = document.documentElement.getAttribute('dir') === 'rtl'; - - /** - * Resets focus to the top of the quiz-entry options for accessibility. - * To ensure that the next keyboard tab after carousel navigation - * will focus the first avaiable quiz option. - */ - const resetFocus = () => { - const quiz = document.querySelector('.quiz-options-container'); - const focuser = createTag('button', { tabindex: 0 }); - quiz.prepend(focuser); - focuser.focus(); - quiz.removeChild(focuser); - }; - - const next = async () => { - if (index + visibleCount < options.data.length) { - setIndex(index + 1); - resetFocus(); - } - }; - - const prev = () => { - if (index > 0) { - setIndex(index - 1); - resetFocus(); - } - }; - - useEffect(() => { - const slide = document.querySelector('.quiz-option'); - if (slide) { - setSlideWidth(slide.offsetWidth); - } - }, [options, slideWidth, setSlideWidth]); - - useEffect(() => { - const handleResize = () => setVisibleCount(window.innerWidth >= 600 ? 6 : 3); - const el = document.querySelector('.quiz-options-container'); - - window.addEventListener('resize', handleResize); - - const swipe = { xMin: 50 }; - - const handleTouchStart = (event) => { - const touch = event.touches[0]; - swipe.xStart = touch.screenX; - }; - - const handleTouchMove = (event) => { - const touch = event.touches[0]; - swipe.xEnd = touch.screenX; - }; - - const handleTouchEnd = () => { - const swipeDistance = {}; - swipeDistance.xDistance = getSwipeDistance(swipe.xStart, swipe.xEnd); - const direction = getSwipeDirection(swipe, swipeDistance); - - swipe.xStart = 0; - swipe.xEnd = 0; - - if (swipeDistance.xDistance > swipe.xMin) { - if (direction === 'left') { - next(); - } else if (direction === 'right') { - prev(); - } - } - }; - - el.addEventListener('touchstart', handleTouchStart); - el.addEventListener('touchmove', handleTouchMove); - el.addEventListener('touchend', handleTouchEnd); - - return () => { - window.removeEventListener('resize', handleResize); - - el.removeEventListener('touchstart', handleTouchStart); - el.removeEventListener('touchmove', handleTouchMove); - el.removeEventListener('touchend', handleTouchEnd); - }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [index, visibleCount, options.data.length]); - - const handleKey = (e) => { - if (e.key === 'ArrowRight') { - e.preventDefault(); - if (isRTL) { - prev(); - } else { - next(); - } - } else if (e.key === 'ArrowLeft') { - e.preventDefault(); - if (isRTL) { - next(); - } else { - prev(); - } - } else if (e.key === 'Enter' || e.key === ' ') { - e.preventDefault(); - if (e.target && e.target.click) { - e.target.click(); - } - } - }; - - return html` -
- ${index > 0 && html``} - - ${(index + visibleCount < options.data.length) && html``} -
`; -}; diff --git a/libs/blocks/quiz-entry/utils.js b/libs/blocks/quiz-entry/utils.js deleted file mode 100644 index 787b4ee79a..0000000000 --- a/libs/blocks/quiz-entry/utils.js +++ /dev/null @@ -1,122 +0,0 @@ -import { getNormalizedMetadata, getLocalizedURL } from '../quiz/utils.js'; - -export async function fetchJson(path) { - const response = await fetch(path); - return response.json(); -} - -export async function getQuizJson(path) { - try { - // Fetch required files - const [questions, strings] = await Promise.all([ - fetchJson(`${path}questions.json`), - fetchJson(`${path}strings.json`), - ]); - - // Try to fetch optional file, results.json - let results = []; - try { - results = await fetchJson(`${path}results.json`); - } catch (ex) { - window.lana?.log(`INFO: results.json not found or couldn't be fetched: ${ex}`, { tags: 'errorType=info,module=quiz-entry' }); - } - - return [questions, strings, results]; - } catch (ex) { - window.lana?.log(`ERROR: Fetching data for quiz entry: ${ex}`, { tags: 'errorType=error,module=quiz-entry' }); - return []; - } -} - -export const handleNext = (questionsData, selectedQuestion, userInputSelections, userFlow) => { - const allcards = Object.keys(userInputSelections); - let nextFlow = []; - let hasResultTrigger = false; - - allcards.forEach((selection) => { - // for each elem in current selection, find its coresponding - // next element and push it to the next array. - const nextItems = questionsData[selectedQuestion.questions].data; - const getAllSelectedQuestionsRelatedOptions = nextItems.filter( - (nextItem) => nextItem.options === selection, - ); - - getAllSelectedQuestionsRelatedOptions.forEach(({ options, next }) => { - if (options === selection) { - const flowStepsList = next.split(','); - // RESET the queue and add only the next question. - if (flowStepsList.includes('RESET')) { // Reset to intial question - nextFlow = []; // Resetting the nextQuizViews - // eslint-disable-next-line no-param-reassign - userFlow = []; // Resetting the userFlow as well - } - - if (!hasResultTrigger) { - hasResultTrigger = flowStepsList.includes('RESULT'); - } - - const filteredNextSteps = flowStepsList.filter((val) => (val !== 'RESULT' && val !== 'RESET')); - - nextFlow = [...nextFlow, ...filteredNextSteps]; - } - }); - }); - - // Stripping off the next steps that are negated using 'NOT()'. - nextFlow.forEach((nextStep) => { - if (nextStep?.startsWith('NOT(')) { - const stepsToSkip = nextStep?.substring( - nextStep.indexOf('(') + 1, - nextStep.lastIndexOf(')'), - ); - const stepsToSkipArr = stepsToSkip?.split(','); - stepsToSkipArr?.forEach((skip) => { - nextFlow = nextFlow.filter((view) => (view !== skip)); - }); - } - }); - - // Filtering out the NOT() from the nextQuizViews. - nextFlow = nextFlow.filter((view) => view.startsWith('NOT(') === false); - - return { nextFlow: [...new Set([...userFlow, ...nextFlow])] }; -}; - -export const handleSelections = (prevSelections, selectedQuestion, selections) => { - const newSelections = { selectedQuestion, selectedCards: selections }; - let nextSelections = []; - let isNewQuestion = true; - // de-dup any existing data if they use the ml field and cards. - if (prevSelections.length > 0) { - prevSelections.forEach((selection) => { - if (JSON.stringify(selection.selectedQuestion) === JSON.stringify(selectedQuestion)) { - selection.selectedCards = selections; - isNewQuestion = false; - } - }); - nextSelections = prevSelections; - } - - if (isNewQuestion) nextSelections.push(newSelections); - - return { nextSelections }; -}; - -export async function getQuizEntryData(el) { - const blockData = getNormalizedMetadata(el); - const dataPath = getLocalizedURL(blockData.data.text); - const quizPath = getLocalizedURL(blockData.quiz.text); - const maxQuestions = Number(blockData.maxquestions?.text) || 10; - const analyticsType = blockData.analyticstype?.text; - const analyticsQuiz = blockData.analyticsquiz?.text; - const [questionData, stringsData, resultsData] = await getQuizJson(dataPath); - return { - quizPath, - maxQuestions, - analyticsQuiz, - analyticsType, - questionData, - stringsData, - resultsData, - }; -} diff --git a/test/blocks/quiz-entry/mocks/index.html b/test/blocks/quiz-entry/mocks/index.html deleted file mode 100644 index 2fedf2fe64..0000000000 --- a/test/blocks/quiz-entry/mocks/index.html +++ /dev/null @@ -1,22 +0,0 @@ -
-
-
data
-
/drafts/quiz/quiz-entry/
-
-
-
quiz
-
/drafts/quiz/
-
-
-
max-questions
-
1
-
-
-
analytics-type
-
cc:app-reco
-
-
-
analytics-quiz
-
UARv4
-
-
diff --git a/test/blocks/quiz-entry/mocks/invalid-user-selection.json b/test/blocks/quiz-entry/mocks/invalid-user-selection.json deleted file mode 100644 index fc081a0f98..0000000000 --- a/test/blocks/quiz-entry/mocks/invalid-user-selection.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "selectedQuestion": { - "questions": "q-category", - "max-selections": "3", - "min-selections": "1" - }, - "selectedCards": { "invalid-option": true } -} diff --git a/test/blocks/quiz-entry/mocks/mock-data.js b/test/blocks/quiz-entry/mocks/mock-data.js deleted file mode 100644 index f369e9f028..0000000000 --- a/test/blocks/quiz-entry/mocks/mock-data.js +++ /dev/null @@ -1,1876 +0,0 @@ -const resultsMock = { - strings: { - 'q-video': { - total: 5, - offset: 0, - limit: 5, - data: [ - { - options: 'social', - title: '', - text: 'Create, edit, and share on social', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/1-PR-CreateEditShare.png', - }, - { - options: 'pro', - title: '', - text: 'Make pro-level edits for high-quality results', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/2-PR-ProLevelEdits.png', - }, - { - options: 'movement', - title: '', - text: 'Create graphics and transitions that move', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/3-AE-TitlesAndTransitions.png', - }, - { - options: 'animate', - title: '', - text: 'Make animations for cartoons or games', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/4-AN-Animations.png', - }, - { - options: 'sound', - title: '', - text: 'Edit, mix, and add sound effects', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/5-AU-SoundEffects.png', - }, - ], - }, - 'q-3d': { - total: 5, - offset: 0, - limit: 5, - data: [ - { - options: 'stage', - title: '', - text: 'Assemble, stage, and render 3D scenes', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/3-Stager@1x.png', - }, - { - options: 'texture', - title: '', - text: 'Texture 3D assets in real time', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/2-Painter@1x.png', - }, - { - options: 'materials', - title: '', - text: 'Create 3D materials from real-life images', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/5-Sampler@1x.png', - }, - { - options: 'model', - title: '', - text: 'Create 3D models with digital clay', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/1-Modeler@1x.png', - }, - { - options: 'assets', - title: '', - text: 'Design 3D assets and materials', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/4-Designer@1x.png', - }, - ], - }, - 'q-category': { - total: 7, - offset: 0, - limit: 7, - data: [ - { - options: 'fi_code', - title: 'Describe your interest here', - text: 'Ask our AI assistant', - icon: 'https://milo.adobe.com/drafts/quiz/quiz-ai/search.svg', - image: '', - }, - { - options: 'photo', - title: 'Photography', - text: 'Edit or organize my photos', - icon: 'https://milo.adobe.com/drafts/quiz/quiz-ai/search.svg', - image: - 'https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/photography.png', - }, - { - options: 'video', - title: 'Video', - text: 'Create and edit video or audio', - icon: '', - image: - 'https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/video.png', - }, - { - options: 'design', - title: 'Graphic design', - text: 'Design layouts or websites', - icon: '', - image: - 'https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/design.png', - }, - { - options: 'illustration', - title: 'Illustration', - text: 'Paint, draw, or create illustrations', - icon: '', - image: - 'https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/illustration.png', - }, - { - options: 'pdf', - title: 'PDFs', - text: 'Create, edit, or sign PDFs', - icon: '', - image: - 'https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/pdf.png', - }, - { - options: '3d', - title: '3D/AR', - text: 'Model, texture, and render 3D assets and scenes', - icon: '', - image: - 'https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/3dar.png', - }, - ], - }, - questions: { - total: 10, - offset: 0, - limit: 10, - data: [ - { - q: 'q-category', - heading: 'Not sure which apps are best for you?', - 'sub-head': - 'Tell us what you’re interested in. We’ll help you figure it out.', - btn: 'Continue', - text: 'Or pick up to 3 below', - background: - 'https://milo.adobe.com/drafts/quiz/quiz-2/quiz-background.jpeg', - footerFragment: '', - }, - { - q: 'q-fallback', - heading: "We're sorry our assistant couldn't help today.", - 'sub-head': 'Please choose up to three options.', - btn: 'Next', - text: '', - background: - 'https://milo.adobe.com/drafts/quiz/quiz-2/quiz-background.jpeg', - footerFragment: '', - }, - { - q: 'q-photo', - heading: 'What do you want to do with photos?', - 'sub-head': 'Pick one.', - btn: 'Next', - text: '', - background: - 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Photo%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', - footerFragment: - 'https://milo.adobe.com/fragments/quiz/sample-uar-fragments/footer/footer1', - }, - { - q: 'q-video', - heading: 'What do you want to do with video?', - 'sub-head': 'Pick one.', - btn: 'Next', - text: '', - background: - 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Photo%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', - footerFragment: '', - }, - { - q: 'q-design', - heading: 'What do you want to do with design?', - 'sub-head': 'Pick one.', - btn: 'Next', - text: '', - background: - 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Design%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', - footerFragment: '', - }, - { - q: 'q-illustration', - heading: 'What do you want to do with illustration?', - 'sub-head': 'Pick one.', - btn: 'Next', - text: '', - background: - 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Illustration%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', - footerFragment: '', - }, - { - q: 'q-pdf', - heading: 'What do you want to do with PDFs?', - 'sub-head': 'Pick one.', - btn: 'Next', - text: '', - background: - 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Acrobat%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', - footerFragment: '', - }, - { - q: 'q-3d', - heading: 'What do you want to do with 3D/AR?', - 'sub-head': 'Pick one.', - btn: 'Next', - text: '', - background: - 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-3D-AR%20BKGD?$pjpeg$&jpegSize=300&wid=1920', - footerFragment: '', - }, - { - q: 'q-rather', - heading: 'For your projects, would you rather:', - 'sub-head': 'Pick one.', - btn: 'Next', - text: '', - background: - 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q3-Learn%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', - footerFragment: '', - }, - { - q: 'q-customer', - heading: 'What else are you looking for today?', - 'sub-head': 'Pick one.', - btn: 'Get your results', - text: '', - background: - 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q4%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', - footerFragment: - 'https://milo.adobe.com/fragments/quiz/sample-uar-fragments/footer/footer2', - }, - ], - }, - 'q-rather': { - total: 2, - offset: 0, - limit: 2, - data: [ - { - options: 'template', - title: '', - text: 'Edit quickly and customize templates', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/1-Templates.png', - }, - { - options: 'custom', - title: '', - text: 'Take the time to control every detail', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/2-CustomDesigns.png', - }, - ], - }, - 'q-photo': { - total: 5, - offset: 0, - limit: 5, - data: [ - { - options: 'organize', - title: '', - text: 'Get them sorted and organized', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/1-LR-StoreAndOrganize.png', - }, - { - options: 'batch', - title: '', - text: 'Edit lots of photos quickly', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/2-LR-ApplyFilters.png', - }, - { - options: 'edit', - title: '', - text: 'Edit and finesse the smallest details', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/3-PS-RemoveObjects.png', - }, - { - options: 'color', - title: '', - text: 'Correct color and lighting like a pro', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/4-PS-MakeDetailedColor.png', - }, - { - options: 'blend', - title: '', - text: 'Blend multiple shots into something new', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/5-PS-BlendImages.png', - }, - ], - }, - 'q-fallback': { - total: 6, - offset: 0, - limit: 6, - data: [ - { - options: 'photo', - title: 'Photography', - text: 'Edit or organize my photos', - icon: 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/1-Photo%20ICON.svg', - image: '', - }, - { - options: 'video', - title: 'Video', - text: 'Create and edit video or audio', - icon: 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/2-Video%20ICON.svg', - image: '', - }, - { - options: 'design', - title: 'Graphic design', - text: 'Design layouts or websites', - icon: 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/3-Design%20ICON.svg', - image: '', - }, - { - options: 'illustration', - title: 'Illustration', - text: 'Paint, draw, or create illustrations', - icon: 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/4-Illustration%20ICON.svg', - image: '', - }, - { - options: 'pdf', - title: 'PDFs', - text: 'Create, edit, or sign PDFs', - icon: 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/5-PDF%20ICON.svg', - image: '', - }, - { - options: '3d', - title: '3D/AR', - text: 'Model, texture, and render 3D assets and scenes', - icon: 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/6-3D-AR%20ICON.svg', - image: '', - }, - ], - }, - 'q-pdf': { - total: 6, - offset: 0, - limit: 6, - data: [ - { - options: 'create', - title: '', - text: 'Create and export PDFs to Office', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/1-Ac-CreateExport.png', - }, - { - options: 'edit', - title: '', - text: 'Edit text and images in PDFs', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/2-Ac-EditText.png', - }, - { - options: 'share', - title: '', - text: 'Share PDFs with anyone', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/3-Ac-Share.png', - }, - { - options: 'secure', - title: '', - text: 'Protect and secure PDFs', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/4-Ac-Protect.png', - }, - { - options: 'sign', - title: '', - text: 'Sign PDFs wherever you are', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/5-Ac-Sign.png', - }, - { - options: 'track', - title: '', - text: 'Track signatures and progress', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/6-Ac-TrackSignatures.png', - }, - ], - }, - 'q-design': { - total: 3, - offset: 0, - limit: 3, - data: [ - { - options: 'layouts', - title: '', - text: 'Create layouts for magazines, books, or posters', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-design/1-%20Id-Layouts.png', - }, - { - options: 'images', - title: '', - text: 'Combine multiple images into new designs', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-design/2-PS-CombineImages.png', - }, - { - options: 'graphics', - title: '', - text: 'Create graphics and designs that work at any size', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-design/3-Ai-CreateGraphics.png', - }, - ], - }, - 'q-illustration': { - total: 4, - offset: 0, - limit: 4, - data: [ - { - options: 'raster', - title: '', - text: 'Paint, draw, or doodle like on paper', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-illustration/1-PS-PaintDraw.png', - }, - { - options: 'vector', - title: '', - text: 'Make illustrations that work at any size', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-illustration/2-Ai-WorkAtAnySize.png', - }, - { - options: 'crisp', - title: '', - text: 'Draw crisp lines and smooth curves', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-illustration/3-Ai-CrispLines.png', - }, - { - options: 'images', - title: '', - text: 'Blend multiple images into something new', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-illustration/4-PS-BlendImages.png', - }, - ], - }, - 'q-customer': { - total: 3, - offset: 0, - limit: 3, - data: [ - { - options: 'educational', - title: '', - text: 'A student or teacher discount', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q4/2-StudentTeacher.png', - }, - { - options: 'business', - title: '', - text: 'Licenses and business features for teams', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q4/3-Work.png', - }, - { - options: 'individual', - title: '', - text: 'Neither apply', - icon: '', - image: - 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q4/1-Individual.png', - }, - ], - }, - ':version': 3, - ':names': [ - 'q-video', - 'q-3d', - 'q-category', - 'questions', - 'q-rather', - 'q-photo', - 'q-fallback', - 'q-pdf', - 'q-design', - 'q-illustration', - 'q-customer', - ], - ':type': 'multi-sheet', - }, - questions: { - 'q-rather': { - total: 2, - offset: 0, - limit: 2, - data: [ - { - options: 'template', - next: 'RESET,q-customer', - 'data-analytics-title': 'ccx', - }, - { - options: 'custom', - next: 'RESULT', - 'data-analytics-title': 'Flagship', - }, - ], - }, - questions: { - total: 9, - offset: 0, - limit: 9, - data: [ - { - questions: 'q-category', - 'max-selections': '3', - 'min-selections': '1', - }, - { - questions: 'q-rather', - 'max-selections': '1', - 'min-selections': '1', - }, - { - questions: 'q-video', - 'max-selections': '1', - 'min-selections': '1', - }, - { - questions: 'q-photo', - 'max-selections': '1', - 'min-selections': '1', - }, - { - questions: 'q-customer', - 'max-selections': '1', - 'min-selections': '1', - }, - { - questions: 'q-3d', - 'max-selections': '1', - 'min-selections': '1', - }, - { - questions: 'q-pdf', - 'max-selections': '1', - 'min-selections': '1', - }, - { - questions: 'q-design', - 'max-selections': '1', - 'min-selections': '1', - }, - { - questions: 'q-illustration', - 'max-selections': '1', - 'min-selections': '1', - }, - ], - }, - 'q-3d': { - total: 5, - offset: 0, - limit: 5, - data: [ - { - options: 'stage', - next: 'q-customer', - }, - { - options: 'texture', - next: 'q-customer', - }, - { - options: 'materials', - next: 'q-customer', - }, - { - options: 'model', - next: 'q-customer', - }, - { - options: 'assets', - next: 'q-customer', - }, - ], - }, - 'q-pdf': { - total: 6, - offset: 0, - limit: 6, - data: [ - { - options: 'create', - next: 'q-customer', - }, - { - options: 'edit', - next: 'q-customer', - }, - { - options: 'share', - next: 'q-customer', - }, - { - options: 'secure', - next: 'q-customer', - }, - { - options: 'sign', - next: 'q-customer', - }, - { - options: 'track', - next: 'q-customer', - }, - ], - }, - 'q-category': { - total: 22, - offset: 0, - limit: 22, - data: [ - { - options: 'fi_code', - next: '', - type: 'form', - endpoint: 'acom-prd-recom-v01', - 'api-key': 'CCHomeMLRepo1', - threshold: '0.7', - fallback: 'photoshop_cc,illustrator_cc,premierepro_cc', - 'ac-endpoint': 'autocomplete', - 'ac-scope': 'adobe_com', - 'ac-client-id': 'adobedotcom2', - }, - { - options: 'photo', - next: 'q-rather,q-photo', - type: 'card', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'video', - next: 'RESET', - type: 'card', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'design', - next: 'q-rather,q-design', - type: 'card', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'illustration', - next: 'q-rather,q-illustration', - type: 'card', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: '3d', - next: 'NOT(q-rather),q-3d', - type: 'card', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'pdf', - next: 'q-rather,q-pdf', - type: 'card', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'acrobat_dc_pro', - next: 'q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'aftereffects_cc', - next: 'q-rather,q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'audition_cc', - next: 'q-rather,q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'flash_professional_cc', - next: 'q-rather,q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'illustrator_cc', - next: 'q-rather,q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'indesign_cc', - next: 'q-rather,q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'lightroom_cc', - next: 'q-rather,q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'photoshop_cc', - next: 'q-rather,q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'premierepro_cc', - next: 'q-rather,q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'sbst_stager', - next: 'q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'sbst_painter', - next: 'q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'sbst_alchemist', - next: 'q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'sbst_shaper', - next: 'q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'sbst_designer', - next: 'q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - { - options: 'free_spark', - next: 'q-customer', - type: 'api_return_code', - endpoint: '', - 'api-key': '', - threshold: '', - fallback: '', - 'ac-endpoint': '', - 'ac-scope': '', - 'ac-client-id': '', - }, - ], - }, - 'q-customer': { - total: 3, - offset: 0, - limit: 3, - data: [ - { - options: 'educational', - next: 'RESULT', - }, - { - options: 'business', - next: 'RESULT', - }, - { - options: 'individual', - next: 'RESULT', - }, - ], - }, - 'q-video': { - total: 5, - offset: 0, - limit: 5, - data: [ - { - options: 'social', - next: 'q-customer', - }, - { - options: 'pro', - next: 'q-customer', - }, - { - options: 'movement', - next: 'q-customer', - }, - { - options: 'animate', - next: 'q-customer', - }, - { - options: 'sound', - next: 'q-customer', - }, - ], - }, - 'q-photo': { - total: 5, - offset: 0, - limit: 5, - data: [ - { - options: 'organize', - next: 'q-customer', - }, - { - options: 'batch', - next: 'q-customer', - }, - { - options: 'edit', - next: 'q-customer', - }, - { - options: 'color', - next: 'q-customer', - }, - { - options: 'blend', - next: 'q-customer', - }, - ], - }, - 'q-design': { - total: 3, - offset: 0, - limit: 3, - data: [ - { - options: 'layouts', - next: 'q-customer', - }, - { - options: 'images', - next: 'q-customer', - }, - { - options: 'graphics', - next: 'q-customer', - }, - ], - }, - 'q-illustration': { - total: 4, - offset: 0, - limit: 4, - data: [ - { - options: 'raster', - next: 'q-customer', - }, - { - options: 'vector', - next: 'q-customer', - }, - { - options: 'crisp', - next: 'q-customer', - }, - { - options: 'images', - next: 'q-customer', - }, - ], - }, - ':version': 3, - ':names': [ - 'q-rather', - 'questions', - 'q-3d', - 'q-pdf', - 'q-category', - 'q-customer', - 'q-video', - 'q-photo', - 'q-design', - 'q-illustration', - ], - ':type': 'multi-sheet', - }, - results: { - result: { - total: 45, - offset: 0, - limit: 45, - data: [ - { - 'q#1': 'acrobat_dc_pro', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'pdf_ste', - 'result-secondary': 'ps_ste,pr_ste,ai_ste', - }, - { - 'q#1': 'acrobat_dc_pro', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'pdf_smb', - 'result-secondary': 'ps_smb,pr_smb,ai_smb', - }, - { - 'q#1': 'acrobat_dc_pro', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'pdf_indiv', - 'result-secondary': 'ps_indiv,pr_indiv,ai_indiv', - }, - { - 'q#1': 'aftereffects_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'ae_ste', - 'result-secondary': 'ps_ste,ai_ste,pr_ste', - }, - { - 'q#1': 'aftereffects_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'ae_smb', - 'result-secondary': 'ps_smb,ai_smb,pr_smb', - }, - { - 'q#1': 'aftereffects_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'ae_indiv', - 'result-secondary': 'ps_indiv,ai_indiv,pr_indiv', - }, - { - 'q#1': 'audition_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'au_ste', - 'result-secondary': 'ps_ste,ai_ste,pr_ste', - }, - { - 'q#1': 'audition_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'au_smb', - 'result-secondary': 'ps_smb,ai_smb,pr_smb', - }, - { - 'q#1': 'audition_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'au_indiv', - 'result-secondary': 'ps_indiv,ai_indiv,pr_indiv', - }, - { - 'q#1': 'flash_professional_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'an_ste', - 'result-secondary': 'ps_ste,ai_ste,pr_ste', - }, - { - 'q#1': 'flash_professional_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'an_smb', - 'result-secondary': 'ps_smb,ai_smb,pr_smb', - }, - { - 'q#1': 'flash_professional_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'an_indiv', - 'result-secondary': 'ps_indiv,ai_indiv,pr_indiv', - }, - { - 'q#1': 'illustrator_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'ai_ste', - 'result-secondary': 'ps_ste,id_ste,pr_ste', - }, - { - 'q#1': 'illustrator_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'ai_smb', - 'result-secondary': 'ps_smb,id_smb,pr_smb', - }, - { - 'q#1': 'illustrator_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'ai_indiv', - 'result-secondary': 'ps_indiv,id_indiv,pr_indiv', - }, - { - 'q#1': 'indesign_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'id_ste', - 'result-secondary': 'ps_ste,ai_ste,pr_ste', - }, - { - 'q#1': 'indesign_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'id_smb', - 'result-secondary': 'ps_smb,ai_smb,pr_smb', - }, - { - 'q#1': 'indesign_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'id_indiv', - 'result-secondary': 'ps_indiv,ai_indiv,pr_indiv', - }, - { - 'q#1': 'lightroom_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'lr_ste', - 'result-secondary': 'lr_ste,ps_ste', - }, - { - 'q#1': 'lightroom_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'lr_smb', - 'result-secondary': 'lr_smb,ps_smb', - }, - { - 'q#1': 'lightroom_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'lr_indiv', - 'result-secondary': 'lr_indiv,ps_indiv', - }, - { - 'q#1': 'photoshop_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'ps_ste', - 'result-secondary': 'ai_ste,id_ste,pr_ste', - }, - { - 'q#1': 'photoshop_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'ps_smb', - 'result-secondary': 'ai_smb,id_smb,pr_smb', - }, - { - 'q#1': 'photoshop_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'ps_indiv', - 'result-secondary': 'ai_indiv,id_indiv,pr_indiv', - }, - { - 'q#1': 'premierepro_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'pr_ste', - 'result-secondary': 'ps_ste,au_ste', - }, - { - 'q#1': 'premierepro_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'pr_smb', - 'result-secondary': 'ps_smb,au_smb,ae_smb', - }, - { - 'q#1': 'premierepro_cc', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'pr_indiv', - 'result-secondary': 'ps_indiv,au_indiv', - }, - { - 'q#1': 'sbst_stager', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'st_ste', - 'result-secondary': 'ps_ste,ai_ste,ae_ste', - }, - { - 'q#1': 'sbst_stager', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'st_smb', - 'result-secondary': 'ps_smb,ai_smb,ae_smb', - }, - { - 'q#1': 'sbst_stager', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'st_indiv', - 'result-secondary': 'ps_indiv,ai_indiv,ae_indiv', - }, - { - 'q#1': 'sbst_painter', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'pt_ste', - 'result-secondary': 'ps_ste,ai_ste,ae_ste', - }, - { - 'q#1': 'sbst_painter', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'pt_smb', - 'result-secondary': 'ps_smb,ai_smb,ae_smb', - }, - { - 'q#1': 'sbst_painter', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'pt_indiv', - 'result-secondary': 'ps_indiv,ai_indiv,ae_indiv', - }, - { - 'q#1': 'sbst_alchemist', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'sa_ste', - 'result-secondary': 'ps_ste,ai_ste,ae_ste', - }, - { - 'q#1': 'sbst_alchemist', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'sa_smb', - 'result-secondary': 'ps_smb,ai_smb,ae_smb', - }, - { - 'q#1': 'sbst_alchemist', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'sa_indiv', - 'result-secondary': 'ps_indiv,ai_indiv,ae_indiv', - }, - { - 'q#1': 'sbst_shaper', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'md_ste', - 'result-secondary': 'ps_ste,ai_ste,ae_ste', - }, - { - 'q#1': 'sbst_shaper', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'md_smb', - 'result-secondary': 'ps_smb,ai_smb,ae_smb', - }, - { - 'q#1': 'sbst_shaper', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'md_indiv', - 'result-secondary': 'ps_indiv,ai_indiv,ae_indiv', - }, - { - 'q#1': 'sbst_designer', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'ds_ste', - 'result-secondary': 'ps_ste,ai_ste,ae_ste', - }, - { - 'q#1': 'sbst_designer', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'ds_smb', - 'result-secondary': 'ps_smb,ai_smb,ae_smb', - }, - { - 'q#1': 'sbst_designer', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'ds_indiv', - 'result-secondary': 'ps_indiv,ai_indiv,ae_indiv', - }, - { - 'q#1': 'free_spark', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'ste', - 'result-primary': 'fi-ax_ste', - 'result-secondary': 'cc_allapps_2_ste,ps_ste,pr_ste', - }, - { - 'q#1': 'free_spark', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'smb', - 'result-primary': 'fi-ax_smb', - 'result-secondary': 'cc_allapps_2_smb,ps_smb,pr_smb', - }, - { - 'q#1': 'free_spark', - 'q#2': '', - 'q#3-photo': '', - 'q#3-video': '', - 'q#3-design': '', - 'q#3-illustr': '', - 'q#3-pdf': '', - 'q#3-3d': '', - 'q#4': 'indiv', - 'result-primary': 'fi-ax_indiv', - 'result-secondary': 'ps_indiv,pr_indiv,ai_indiv', - }, - ], - }, - 'result-fragments': { - total: 6, - offset: 0, - limit: 6, - data: [ - { - product: 'open-text-ax_indiv', - marquee: '/fragments/uar/marquee/ccx', - 'marquee-plan': '/fragments/uar/marquee/marquee-plan/ccx', - 'check-bullet': - '/fragments/uar/marquee/marquee-bullets/check-bullet/ax-uc1', - 'icon-bullet': 'N/A', - 'card-list': '/fragments/uar/cross-sell/card-list', - 'commerce-card': '', - 'plan-card': 'N/A', - learn: '/fragments/uar/learn/learn-express', - 'ff-banner': '/fragments/uar/banners/firefly', - 'value-prop': 'N/A', - 'social-blade': '/fragments/uar/express-social/individual', - 'legal-copy': 'N/A', - }, - { - product: 'open-text-ax_ste', - marquee: '/fragments/uar/marquee/ccx', - 'marquee-plan': '/fragments/uar/marquee/marquee-plan/ccx-ste', - 'check-bullet': - '/fragments/uar/marquee/marquee-bullets/check-bullet/ax-ste1', - 'icon-bullet': 'N/A', - 'card-list': '/fragments/uar/cross-sell/card-list', - 'commerce-card': '', - 'plan-card': 'N/A', - learn: '/fragments/uar/learn/learn-express', - 'ff-banner': '/fragments/uar/banners/firefly-ste', - 'value-prop': 'N/A', - 'social-blade': '/fragments/uar/express-social/students', - 'legal-copy': 'N/A', - }, - { - product: 'open-text-ax_smb', - marquee: '/fragments/uar/marquee/ccx', - 'marquee-plan': '/fragments/uar/marquee/marquee-plan/ccx-cct', - 'check-bullet': - '/fragments/uar/marquee/marquee-bullets/check-bullet/ax-cct1', - 'icon-bullet': 'N/A', - 'card-list': '/fragments/uar/cross-sell/card-list', - 'commerce-card': '', - 'plan-card': 'N/A', - learn: '/fragments/uar/learn/learn-express', - 'ff-banner': '/fragments/uar/banners/firefly-cct', - 'value-prop': 'N/A', - 'social-blade': '/fragments/uar/express-social/teams', - 'legal-copy': 'N/A', - }, - { - product: 'fi-ax_indiv', - marquee: '/fragments/uar/marquee/ccx', - 'marquee-plan': '/fragments/uar/marquee/marquee-plan/ccx', - 'check-bullet': - '/fragments/uar/marquee/marquee-bullets/check-bullet/ax-uc1', - 'icon-bullet': 'N/A', - 'card-list': '/fragments/uar/cross-sell/card-list', - 'commerce-card': '/fragments/uar/cross-sell/commerce-cards/cci', - 'plan-card': 'N/A', - learn: '/fragments/uar/learn/learn-express', - 'ff-banner': '/fragments/uar/banners/firefly', - 'value-prop': 'N/A', - 'social-blade': '/fragments/uar/express-social/individual', - 'legal-copy': 'N/A', - }, - { - product: 'fi-ax_ste', - marquee: '/fragments/uar/marquee/ccx', - 'marquee-plan': '/fragments/uar/marquee/marquee-plan/ccx-ste', - 'check-bullet': - '/fragments/uar/marquee/marquee-bullets/check-bullet/ax-ste1', - 'icon-bullet': 'N/A', - 'card-list': '/fragments/uar/cross-sell/card-list', - 'commerce-card': '/fragments/uar/cross-sell/commerce-cards/cci-ste', - 'plan-card': 'N/A', - learn: '/fragments/uar/learn/learn-express', - 'ff-banner': '/fragments/uar/banners/firefly-ste', - 'value-prop': 'N/A', - 'social-blade': '/fragments/uar/express-social/students', - 'legal-copy': 'N/A', - }, - { - product: 'fi-ax_smb', - marquee: '/fragments/uar/marquee/ccx', - 'marquee-plan': '/fragments/uar/marquee/marquee-plan/ccx-cct', - 'check-bullet': - '/fragments/uar/marquee/marquee-bullets/check-bullet/ax-cct1', - 'icon-bullet': 'N/A', - 'card-list': '/fragments/uar/cross-sell/card-list', - 'commerce-card': '/fragments/uar/cross-sell/commerce-cards/cci-cct', - 'plan-card': 'N/A', - learn: '/fragments/uar/learn/learn-express', - 'ff-banner': '/fragments/uar/banners/firefly-cct', - 'value-prop': 'N/A', - 'social-blade': '/fragments/uar/express-social/teams', - 'legal-copy': 'N/A', - }, - ], - }, - 'result-destination': { - total: 9, - offset: 0, - limit: 9, - data: [ - { - result: '(fi-ax_indiv)', - 'umbrella-result': '', - url: '/drafts/quiz/plan-recommender-var/quiz-results', - 'basic-fragments': 'marquee,card-list,social-blade,ff-banner,learn', - 'nested-fragments-primary': 'check-bullet,marquee-plan', - 'nested-fragments-secondary': 'commerce-card', - }, - { - result: '(fi-ax_ste)', - 'umbrella-result': '', - url: '/drafts/quiz/plan-recommender-var/quiz-results', - 'basic-fragments': 'marquee,card-list,social-blade,learn', - 'nested-fragments-primary': 'check-bullet,marquee-plan', - 'nested-fragments-secondary': 'commerce-card', - }, - { - result: '(fi-ax_smb)', - 'umbrella-result': '', - url: '/drafts/quiz/plan-recommender-var/quiz-results', - 'basic-fragments': 'marquee,card-list,social-blade,ff-banner,learn', - 'nested-fragments-primary': 'check-bullet,marquee-plan', - 'nested-fragments-secondary': 'commerce-card', - }, - { - result: - '(fi-ax_indiv,pr_indiv,ae_indiv,an_indiv,au_indiv,id_indiv,ai_indiv,ps_indiv,pdf_indiv,lr_indiv,st_indiv,pt_indiv,sa_indiv,md_indiv,ds_indiv)&(fi-ax_indiv,pr_indiv,ae_indiv,an_indiv,au_indiv,id_indiv,ai_indiv,ps_indiv,pdf_indiv,lr_indiv,st_indiv,pt_indiv,sa_indiv,md_indiv,ds_indiv)', - 'umbrella-result': 'open-text-ax_indiv', - url: '/drafts/quiz/plan-recommender-var/quiz-results', - 'basic-fragments': 'marquee,card-list,social-blade,ff-banner,learn', - 'nested-fragments-primary': 'check-bullet,marquee-plan', - 'nested-fragments-secondary': 'commerce-card', - }, - { - result: - '(fi-ax_ste,pr_ste,ae_ste,an_ste,au_ste,id_ste,ai_ste,ps_ste,pdf_ste,lr_ste,st_ste,pt_ste,sa_ste,md_ste,ds_ste)&(fi-ax_ste,pr_ste,ae_ste,an_ste,au_ste,id_ste,ai_ste,ps_ste,pdf_ste,lr_ste,st_ste,pt_ste,sa_ste,md_ste,ds_ste)', - 'umbrella-result': 'open-text-ax_ste', - url: '/drafts/quiz/plan-recommender-var/quiz-results', - 'basic-fragments': 'marquee,card-list,social-blade,learn', - 'nested-fragments-primary': 'check-bullet,marquee-plan', - 'nested-fragments-secondary': 'commerce-card', - }, - { - result: - '(fi-ax_smb,pr_smb,ae_smb,an_smb,au_smb,id_smb,ai_smb,ps_smb,pdf_smb,lr_smb,st_smb,pt_smb,sa_smb,md_smb,ds_smb,smb,smb)&(fi-ax_smb,pr_smb,ae_smb,an_smb,au_smb,id_smb,ai_smb,ps_smb,pdf_smb,lr_smb,st_smb,pt_smb,sa_smb,md_smb,ds_smb,smb,smb)', - 'umbrella-result': 'open-text-ax_smb', - url: '/drafts/quiz/plan-recommender-var/quiz-results', - 'basic-fragments': 'marquee,card-list,social-blade,ff-banner,learn', - 'nested-fragments-primary': 'check-bullet,marquee-plan', - 'nested-fragments-secondary': 'commerce-card', - }, - { - result: - '(fi-ax_indiv,pr_indiv,ae_indiv,an_indiv,au_indiv,id_indiv,ai_indiv,ps_indiv,pdf_indiv,lr_indiv,st_indiv,pt_indiv,sa_indiv,md_indiv,ds_indiv)&(fi-ax_indiv,pr_indiv,ae_indiv,an_indiv,au_indiv,id_indiv,ai_indiv,ps_indiv,pdf_indiv,lr_indiv,st_indiv,pt_indiv,sa_indiv,md_indiv,ds_indiv)&(fi-ax_indiv,pr_indiv,ae_indiv,an_indiv,au_indiv,id_indiv,ai_indiv,ps_indiv,pdf_indiv,lr_indiv,st_indiv,pt_indiv,sa_indiv,md_indiv,ds_indiv)', - 'umbrella-result': 'open-text-ax_indiv', - url: '/drafts/quiz/plan-recommender-var/quiz-results', - 'basic-fragments': 'marquee,card-list,social-blade,ff-banner,learn', - 'nested-fragments-primary': 'check-bullet,marquee-plan', - 'nested-fragments-secondary': 'commerce-card', - }, - { - result: - '(fi-ax_ste,pr_ste,ae_ste,an_ste,au_ste,id_ste,ai_ste,ps_ste,pdf_ste,lr_ste,st_ste,pt_ste,sa_ste,md_ste,ds_ste)&(fi-ax_ste,pr_ste,ae_ste,an_ste,au_ste,id_ste,ai_ste,ps_ste,pdf_ste,lr_ste,st_ste,pt_ste,sa_ste,md_ste,ds_ste)&(fi-ax_ste,pr_ste,ae_ste,an_ste,au_ste,id_ste,ai_ste,ps_ste,pdf_ste,lr_ste,st_ste,pt_ste,sa_ste,md_ste,ds_ste)', - 'umbrella-result': 'open-text-ax_ste', - url: '/drafts/quiz/plan-recommender-var/quiz-results', - 'basic-fragments': 'marquee,card-list,social-blade,learn', - 'nested-fragments-primary': 'check-bullet,marquee-plan', - 'nested-fragments-secondary': 'commerce-card', - }, - { - result: - '(fi-ax_smb,pr_smb,ae_smb,an_smb,au_smb,id_smb,ai_smb,ps_smb,pdf_smb,lr_smb,st_smb,pt_smb,sa_smb,md_smb,ds_smb,smb,smb)&(fi-ax_smb,pr_smb,ae_smb,an_smb,au_smb,id_smb,ai_smb,ps_smb,pdf_smb,lr_smb,st_smb,pt_smb,sa_smb,md_smb,ds_smb,smb,smb)&(fi-ax_smb,pr_smb,ae_smb,an_smb,au_smb,id_smb,ai_smb,ps_smb,pdf_smb,lr_smb,st_smb,pt_smb,sa_smb,md_smb,ds_smb,smb,smb)', - 'umbrella-result': 'open-text-ax_smb', - url: '/drafts/quiz/plan-recommender-var/quiz-results', - 'basic-fragments': 'marquee,card-list,social-blade,ff-banner,learn', - 'nested-fragments-primary': 'check-bullet,marquee-plan', - 'nested-fragments-secondary': 'commerce-card', - }, - ], - }, - ':version': 3, - ':names': ['result', 'result-fragments', 'result-destination'], - ':type': 'multi-sheet', - }, -}; - -export default resultsMock; diff --git a/test/blocks/quiz-entry/mocks/mock-states.js b/test/blocks/quiz-entry/mocks/mock-states.js deleted file mode 100644 index 78c4514178..0000000000 --- a/test/blocks/quiz-entry/mocks/mock-states.js +++ /dev/null @@ -1,139 +0,0 @@ -export const userSelection = [ - { - selectedQuestion: { - questions: 'q-category', - 'max-selections': '3', - 'min-selections': '1', - }, - selectedCards: { - photo: true, - video: true, - }, - }, - { - selectedQuestion: { - questions: 'q-rather', - 'max-selections': '1', - 'min-selections': '1', - }, - selectedCards: { custom: true }, - }, - { - selectedQuestion: { - questions: 'q-photo', - 'max-selections': '1', - 'min-selections': '1', - }, - selectedCards: { organize: true }, - }, - { - selectedQuestion: { - questions: 'q-video', - 'max-selections': '1', - 'min-selections': '1', - }, - selectedCards: { social: true }, - }, - { - selectedQuestion: { - questions: 'q-customer', - 'max-selections': '1', - 'min-selections': '1', - }, - selectedCards: { individual: true }, - }, -]; - -export const answers = [ - ['q-category', ['photo', 'video']], - ['q-rather', ['custom']], - ['q-photo', ['organize']], - ['q-video', ['social']], - ['q-customer', ['individual']], -]; - -export const resultRules = [ - { - result: '(ai,ai-edu,ai-bus,ai-ind,au-edu,au-bus,au-ind,an-edu,an-bus,an-ind,ae-edu,ae-bus,ae-ind,lr-edu,lr-bus,lr-ind,id,pr-edu,pr-bus,pr-ind,ps-bus,ps-edu,ps-ind,ac,pdf)&(ai,ai-edu,ai-bus,ai-ind,au-edu,au-bus,au-ind,an-edu,an-bus,an-ind,ae-edu,ae-bus,ae-ind,lr-edu,lr-bus,lr-ind,id,pr-edu,pr-bus,pr-ind,ps-bus,ps-edu,ps-ind,ac,pdf)', - 'umbrella-result': 'cc', - url: '/path/to/result', - 'basic-fragments': 'marquee, card-list', - 'nested-fragments-primary': '', - 'nested-fragments-secondary': 'marquee-product, commerce-card', - }, - { - result: '(ai,ai-edu,ai-bus,ai-ind,au-edu,au-bus,au-ind,an-edu,an-bus,an-ind,ae-edu,ae-bus,ae-ind,lr-edu,lr-bus,lr-ind,id,pr-edu,pr-bus,pr-ind,ps-bus,ps-edu,ps-ind,ac,pdf)', - 'umbrella-result': '', - url: '/path/to/result', - 'basic-fragments': 'marquee, card-list', - 'nested-fragments-primary': 'check-bullet,marquee-plan', - 'nested-fragments-secondary': 'commerce-card', - }, - { - result: '(3d,ai,ai-edu,ai-bus,ai-ind,au-edu,au-bus,au-ind,an-edu,an-bus,an-ind,ae-edu,ae-bus,ae-ind,lr-edu,lr-bus,lr-ind,id,pr-edu,pr-bus,pr-ind,ps-bus,ps-edu,ps-ind,ac,pdf)&(3d,ai,ai-edu,ai-bus,ai-ind,au-edu,au-bus,au-ind,an-edu,an-bus,an-ind,ae-edu,ae-bus,ae-ind,lr-edu,lr-bus,lr-ind,id,pr-edu,pr-bus,pr-ind,ps-bus,ps-edu,ps-ind,ac,pdf)', - 'umbrella-result': '3d-umbrella', - url: '/path/to/result', - 'basic-fragments': 'marquee, card-list', - 'nested-fragments-primary': '', - 'nested-fragments-secondary': '', - }, - { - result: 'default', - 'umbrella-result': '', - url: '/path/to/result', - 'basic-fragments': 'marquee, card-list', - 'nested-fragments-primary': '', - 'nested-fragments-secondary': 'commerce-card', - }, - { - result: 'express', - 'umbrella-result': '', - url: '/path/to/result', - 'basic-fragments': 'marquee, card-list', - 'nested-fragments-primary': '', - 'nested-fragments-secondary': 'commerce-card', - }, -]; - -export const resultData = { - primary: [ - 'lr-ind', - 'pr-ind', - ], - secondary: [ - 'ps-ind', - 'au-ind', - ], - matchedResults: [ - { - result: '(ai,ai-edu,ai-bus,ai-ind,au-edu,au-bus,au-ind,an-edu,an-bus,an-ind,ae-edu,ae-bus,ae-ind,lr-edu,lr-bus,lr-ind,id,pr-edu,pr-bus,pr-ind,ps-bus,ps-edu,ps-ind,ac,pdf)&(ai,ai-edu,ai-bus,ai-ind,au-edu,au-bus,au-ind,an-edu,an-bus,an-ind,ae-edu,ae-bus,ae-ind,lr-edu,lr-bus,lr-ind,id,pr-edu,pr-bus,pr-ind,ps-bus,ps-edu,ps-ind,ac,pdf)', - 'umbrella-result': 'cc', - url: '/path/to/result', - 'basic-fragments': 'marquee, card-list', - 'nested-fragments': 'marquee-product, commerce-card', - }, - ], -}; - -export const storedData = { - userFlow: [ - 'q-rather', - 'q-photo', - 'q-video', - 'q-design', - ], - userSelection: [ - { - selectedQuestion: { - questions: 'q-category', - 'max-selections': '3', - 'min-selections': '1', - }, - selectedCards: { - photo: true, - video: true, - design: true, - }, - }, - ], -}; diff --git a/test/blocks/quiz-entry/mocks/questions.json b/test/blocks/quiz-entry/mocks/questions.json deleted file mode 100644 index cecdffbb25..0000000000 --- a/test/blocks/quiz-entry/mocks/questions.json +++ /dev/null @@ -1,529 +0,0 @@ -{ - "q-rather": { - "total": 2, - "offset": 0, - "limit": 2, - "data": [ - { - "options": "template", - "next": "RESET,q-customer", - "data-analytics-title": "ccx" - }, - { - "options": "custom", - "next": "RESULT", - "data-analytics-title": "Flagship" - } - ] - }, - "questions": { - "total": 9, - "offset": 0, - "limit": 9, - "data": [ - { - "questions": "q-category", - "max-selections": "3", - "min-selections": "1" - }, - { - "questions": "q-rather", - "max-selections": "1", - "min-selections": "1" - }, - { - "questions": "q-video", - "max-selections": "1", - "min-selections": "1" - }, - { - "questions": "q-photo", - "max-selections": "1", - "min-selections": "1" - }, - { - "questions": "q-customer", - "max-selections": "1", - "min-selections": "1" - }, - { - "questions": "q-3d", - "max-selections": "1", - "min-selections": "1" - }, - { - "questions": "q-pdf", - "max-selections": "1", - "min-selections": "1" - }, - { - "questions": "q-design", - "max-selections": "1", - "min-selections": "1" - }, - { - "questions": "q-illustration", - "max-selections": "1", - "min-selections": "1" - } - ] - }, - "q-3d": { - "total": 5, - "offset": 0, - "limit": 5, - "data": [ - { - "options": "stage", - "next": "q-customer" - }, - { - "options": "texture", - "next": "q-customer" - }, - { - "options": "materials", - "next": "q-customer" - }, - { - "options": "model", - "next": "q-customer" - }, - { - "options": "assets", - "next": "q-customer" - } - ] - }, - "q-pdf": { - "total": 6, - "offset": 0, - "limit": 6, - "data": [ - { - "options": "create", - "next": "q-customer" - }, - { - "options": "edit", - "next": "q-customer" - }, - { - "options": "share", - "next": "q-customer" - }, - { - "options": "secure", - "next": "q-customer" - }, - { - "options": "sign", - "next": "q-customer" - }, - { - "options": "track", - "next": "q-customer" - } - ] - }, - "q-category": { - "total": 22, - "offset": 0, - "limit": 22, - "data": [ - { - "options": "fi_code", - "next": "", - "type": "form", - "endpoint": "acom-prd-recom-v01", - "api-key": "CCHomeMLRepo1", - "threshold": "0.7", - "fallback": "photoshop_cc,illustrator_cc,premierepro_cc", - "ac-endpoint": "autocomplete", - "ac-scope": "adobe_com", - "ac-client-id": "adobedotcom2" - }, - { - "options": "photo", - "next": "q-rather,q-photo", - "type": "card", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "video", - "next": "q-rather,q-video", - "type": "card", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "design", - "next": "q-rather,q-design", - "type": "card", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "illustration", - "next": "q-rather,q-illustration", - "type": "card", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "3d", - "next": "NOT(q-rather),q-3d", - "type": "card", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "pdf", - "next": "q-rather,q-pdf", - "type": "card", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "acrobat_dc_pro", - "next": "q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "aftereffects_cc", - "next": "q-rather,q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "audition_cc", - "next": "q-rather,q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "flash_professional_cc", - "next": "q-rather,q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "illustrator_cc", - "next": "q-rather,q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "indesign_cc", - "next": "q-rather,q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "lightroom_cc", - "next": "q-rather,q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "photoshop_cc", - "next": "q-rather,q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "premierepro_cc", - "next": "q-rather,q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "sbst_stager", - "next": "q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "sbst_painter", - "next": "q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "sbst_alchemist", - "next": "q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "sbst_shaper", - "next": "q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "sbst_designer", - "next": "q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - }, - { - "options": "free_spark", - "next": "q-customer", - "type": "api_return_code", - "endpoint": "", - "api-key": "", - "threshold": "", - "fallback": "", - "ac-endpoint": "", - "ac-scope": "", - "ac-client-id": "" - } - ] - }, - "q-customer": { - "total": 3, - "offset": 0, - "limit": 3, - "data": [ - { - "options": "educational", - "next": "RESULT" - }, - { - "options": "business", - "next": "RESULT" - }, - { - "options": "individual", - "next": "RESULT" - } - ] - }, - "q-video": { - "total": 5, - "offset": 0, - "limit": 5, - "data": [ - { - "options": "social", - "next": "q-customer" - }, - { - "options": "pro", - "next": "q-customer" - }, - { - "options": "movement", - "next": "q-customer" - }, - { - "options": "animate", - "next": "q-customer" - }, - { - "options": "sound", - "next": "q-customer" - } - ] - }, - "q-photo": { - "total": 5, - "offset": 0, - "limit": 5, - "data": [ - { - "options": "organize", - "next": "q-customer" - }, - { - "options": "batch", - "next": "q-customer" - }, - { - "options": "edit", - "next": "q-customer" - }, - { - "options": "color", - "next": "q-customer" - }, - { - "options": "blend", - "next": "q-customer" - } - ] - }, - "q-design": { - "total": 3, - "offset": 0, - "limit": 3, - "data": [ - { - "options": "layouts", - "next": "q-customer" - }, - { - "options": "images", - "next": "q-customer" - }, - { - "options": "graphics", - "next": "q-customer" - } - ] - }, - "q-illustration": { - "total": 4, - "offset": 0, - "limit": 4, - "data": [ - { - "options": "raster", - "next": "q-customer" - }, - { - "options": "vector", - "next": "q-customer" - }, - { - "options": "crisp", - "next": "q-customer" - }, - { - "options": "images", - "next": "q-customer" - } - ] - }, - ":version": 3, - ":names": [ - "q-rather", - "questions", - "q-3d", - "q-pdf", - "q-category", - "q-customer", - "q-video", - "q-photo", - "q-design", - "q-illustration" - ], - ":type": "multi-sheet" -} diff --git a/test/blocks/quiz-entry/mocks/quiz.html b/test/blocks/quiz-entry/mocks/quiz.html deleted file mode 100644 index 3c0aead1ad..0000000000 --- a/test/blocks/quiz-entry/mocks/quiz.html +++ /dev/null @@ -1,24 +0,0 @@ -
-
-
-
data
-
/drafts/colloyd/quiz-entry/
-
-
-
quiz
-
/drafts/colloyd/quiz/
-
-
-
max-questions
-
1
-
-
-
analytics-type
-
cc:app-reco
-
-
-
analytics-quiz
-
UARv4
-
-
-
diff --git a/test/blocks/quiz-entry/mocks/result-resources.json b/test/blocks/quiz-entry/mocks/result-resources.json deleted file mode 100644 index cc6929189c..0000000000 --- a/test/blocks/quiz-entry/mocks/result-resources.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "total": 25, - "offset": 0, - "limit": 25, - "data": [ - { - "product": "ps-edu", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "ps-bus", - "marquee": "/path/to/marquee", - "card-list": "", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "ps-ind", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "lr-edu", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "lr-bus", - "marquee": "/path/to/marquee", - "card-list": "", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "lr-ind", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "pr-edu", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "pr-bus", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "pr-ind", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "ae", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "an", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "/fragments/card/animate", - "marquee-product": "", - "page": "" - }, - { - "product": "au", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "id", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "ai", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "acrobat-pro", - "marquee": "/fragments/marquee/acrobat", - "card-list": "", - "commerce-card": "/fragments/card/acrobat", - "marquee-product": "", - "page": "" - }, - { - "product": "substance-3d-collection", - "marquee": "/fragments/marquee/subtance-3d", - "card-list": "", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "substance-3d-stager", - "marquee": "/fragments/marquee/subtance-3d-stager", - "card-list": "", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "substance-3d-painter", - "marquee": "/fragments/marquee/subtance-3d-painter", - "card-list": "", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "substance-3d-sampler", - "marquee": "/fragments/marquee/subtance-3d-sampler", - "card-list": "", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "substance-3d-modeler", - "marquee": "/fragments/marquee/subtance-3d-modeler", - "card-list": "", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "substance-3d-designer", - "marquee": "/fragments/marquee/subtance-3d-designer", - "card-list": "", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "express", - "marquee": "/path/to/marquee", - "card-list": "", - "commerce-card": "path-to-commerce-card", - "marquee-product": "", - "page": "" - }, - { - "product": "cc", - "marquee": "/path/to/marquee", - "card-list": "/path/to/cardlist", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "ac", - "marquee": "", - "card-list": "", - "commerce-card": "", - "marquee-product": "", - "page": "" - }, - { - "product": "3d-umbrella", - "marquee": "", - "card-list": "", - "commerce-card": "", - "marquee-product": "", - "page": "" - } - ] -} diff --git a/test/blocks/quiz-entry/mocks/results.json b/test/blocks/quiz-entry/mocks/results.json deleted file mode 100644 index 6028b524c7..0000000000 --- a/test/blocks/quiz-entry/mocks/results.json +++ /dev/null @@ -1,777 +0,0 @@ -{ - "result": { - "total": 45, - "offset": 0, - "limit": 45, - "data": [ - { - "q#1": "acrobat_dc_pro", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "pdf_ste", - "result-secondary": "ps_ste,pr_ste,ai_ste" - }, - { - "q#1": "acrobat_dc_pro", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "pdf_smb", - "result-secondary": "ps_smb,pr_smb,ai_smb" - }, - { - "q#1": "acrobat_dc_pro", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "pdf_indiv", - "result-secondary": "ps_indiv,pr_indiv,ai_indiv" - }, - { - "q#1": "aftereffects_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "ae_ste", - "result-secondary": "ps_ste,ai_ste,pr_ste" - }, - { - "q#1": "aftereffects_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "ae_smb", - "result-secondary": "ps_smb,ai_smb,pr_smb" - }, - { - "q#1": "aftereffects_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "ae_indiv", - "result-secondary": "ps_indiv,ai_indiv,pr_indiv" - }, - { - "q#1": "audition_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "au_ste", - "result-secondary": "ps_ste,ai_ste,pr_ste" - }, - { - "q#1": "audition_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "au_smb", - "result-secondary": "ps_smb,ai_smb,pr_smb" - }, - { - "q#1": "audition_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "au_indiv", - "result-secondary": "ps_indiv,ai_indiv,pr_indiv" - }, - { - "q#1": "flash_professional_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "an_ste", - "result-secondary": "ps_ste,ai_ste,pr_ste" - }, - { - "q#1": "flash_professional_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "an_smb", - "result-secondary": "ps_smb,ai_smb,pr_smb" - }, - { - "q#1": "flash_professional_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "an_indiv", - "result-secondary": "ps_indiv,ai_indiv,pr_indiv" - }, - { - "q#1": "illustrator_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "ai_ste", - "result-secondary": "ps_ste,id_ste,pr_ste" - }, - { - "q#1": "illustrator_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "ai_smb", - "result-secondary": "ps_smb,id_smb,pr_smb" - }, - { - "q#1": "illustrator_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "ai_indiv", - "result-secondary": "ps_indiv,id_indiv,pr_indiv" - }, - { - "q#1": "indesign_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "id_ste", - "result-secondary": "ps_ste,ai_ste,pr_ste" - }, - { - "q#1": "indesign_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "id_smb", - "result-secondary": "ps_smb,ai_smb,pr_smb" - }, - { - "q#1": "indesign_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "id_indiv", - "result-secondary": "ps_indiv,ai_indiv,pr_indiv" - }, - { - "q#1": "lightroom_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "lr_ste", - "result-secondary": "lr_ste,ps_ste" - }, - { - "q#1": "lightroom_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "lr_smb", - "result-secondary": "lr_smb,ps_smb" - }, - { - "q#1": "lightroom_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "lr_indiv", - "result-secondary": "lr_indiv,ps_indiv" - }, - { - "q#1": "photoshop_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "ps_ste", - "result-secondary": "ai_ste,id_ste,pr_ste" - }, - { - "q#1": "photoshop_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "ps_smb", - "result-secondary": "ai_smb,id_smb,pr_smb" - }, - { - "q#1": "photoshop_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "ps_indiv", - "result-secondary": "ai_indiv,id_indiv,pr_indiv" - }, - { - "q#1": "premierepro_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "pr_ste", - "result-secondary": "ps_ste,au_ste" - }, - { - "q#1": "premierepro_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "pr_smb", - "result-secondary": "ps_smb,au_smb,ae_smb" - }, - { - "q#1": "premierepro_cc", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "pr_indiv", - "result-secondary": "ps_indiv,au_indiv" - }, - { - "q#1": "sbst_stager", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "st_ste", - "result-secondary": "ps_ste,ai_ste,ae_ste" - }, - { - "q#1": "sbst_stager", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "st_smb", - "result-secondary": "ps_smb,ai_smb,ae_smb" - }, - { - "q#1": "sbst_stager", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "st_indiv", - "result-secondary": "ps_indiv,ai_indiv,ae_indiv" - }, - { - "q#1": "sbst_painter", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "pt_ste", - "result-secondary": "ps_ste,ai_ste,ae_ste" - }, - { - "q#1": "sbst_painter", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "pt_smb", - "result-secondary": "ps_smb,ai_smb,ae_smb" - }, - { - "q#1": "sbst_painter", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "pt_indiv", - "result-secondary": "ps_indiv,ai_indiv,ae_indiv" - }, - { - "q#1": "sbst_alchemist", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "sa_ste", - "result-secondary": "ps_ste,ai_ste,ae_ste" - }, - { - "q#1": "sbst_alchemist", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "sa_smb", - "result-secondary": "ps_smb,ai_smb,ae_smb" - }, - { - "q#1": "sbst_alchemist", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "sa_indiv", - "result-secondary": "ps_indiv,ai_indiv,ae_indiv" - }, - { - "q#1": "sbst_shaper", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "md_ste", - "result-secondary": "ps_ste,ai_ste,ae_ste" - }, - { - "q#1": "sbst_shaper", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "md_smb", - "result-secondary": "ps_smb,ai_smb,ae_smb" - }, - { - "q#1": "sbst_shaper", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "md_indiv", - "result-secondary": "ps_indiv,ai_indiv,ae_indiv" - }, - { - "q#1": "sbst_designer", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "ds_ste", - "result-secondary": "ps_ste,ai_ste,ae_ste" - }, - { - "q#1": "sbst_designer", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "ds_smb", - "result-secondary": "ps_smb,ai_smb,ae_smb" - }, - { - "q#1": "sbst_designer", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "ds_indiv", - "result-secondary": "ps_indiv,ai_indiv,ae_indiv" - }, - { - "q#1": "free_spark", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "ste", - "result-primary": "fi-ax_ste", - "result-secondary": "cc_allapps_2_ste,ps_ste,pr_ste" - }, - { - "q#1": "free_spark", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "smb", - "result-primary": "fi-ax_smb", - "result-secondary": "cc_allapps_2_smb,ps_smb,pr_smb" - }, - { - "q#1": "free_spark", - "q#2": "", - "q#3-photo": "", - "q#3-video": "", - "q#3-design": "", - "q#3-illustr": "", - "q#3-pdf": "", - "q#3-3d": "", - "q#4": "indiv", - "result-primary": "fi-ax_indiv", - "result-secondary": "ps_indiv,pr_indiv,ai_indiv" - } - ] - }, - "result-fragments": { - "total": 6, - "offset": 0, - "limit": 6, - "data": [ - { - "product": "open-text-ax_indiv", - "marquee": "/fragments/uar/marquee/ccx", - "marquee-plan": "/fragments/uar/marquee/marquee-plan/ccx", - "check-bullet": "/fragments/uar/marquee/marquee-bullets/check-bullet/ax-uc1", - "icon-bullet": "N/A", - "card-list": "/fragments/uar/cross-sell/card-list", - "commerce-card": "", - "plan-card": "N/A", - "learn": "/fragments/uar/learn/learn-express", - "ff-banner": "/fragments/uar/banners/firefly", - "value-prop": "N/A", - "social-blade": "/fragments/uar/express-social/individual", - "legal-copy": "N/A" - }, - { - "product": "open-text-ax_ste", - "marquee": "/fragments/uar/marquee/ccx", - "marquee-plan": "/fragments/uar/marquee/marquee-plan/ccx-ste", - "check-bullet": "/fragments/uar/marquee/marquee-bullets/check-bullet/ax-ste1", - "icon-bullet": "N/A", - "card-list": "/fragments/uar/cross-sell/card-list", - "commerce-card": "", - "plan-card": "N/A", - "learn": "/fragments/uar/learn/learn-express", - "ff-banner": "/fragments/uar/banners/firefly-ste", - "value-prop": "N/A", - "social-blade": "/fragments/uar/express-social/students", - "legal-copy": "N/A" - }, - { - "product": "open-text-ax_smb", - "marquee": "/fragments/uar/marquee/ccx", - "marquee-plan": "/fragments/uar/marquee/marquee-plan/ccx-cct", - "check-bullet": "/fragments/uar/marquee/marquee-bullets/check-bullet/ax-cct1", - "icon-bullet": "N/A", - "card-list": "/fragments/uar/cross-sell/card-list", - "commerce-card": "", - "plan-card": "N/A", - "learn": "/fragments/uar/learn/learn-express", - "ff-banner": "/fragments/uar/banners/firefly-cct", - "value-prop": "N/A", - "social-blade": "/fragments/uar/express-social/teams", - "legal-copy": "N/A" - }, - { - "product": "fi-ax_indiv", - "marquee": "/fragments/uar/marquee/ccx", - "marquee-plan": "/fragments/uar/marquee/marquee-plan/ccx", - "check-bullet": "/fragments/uar/marquee/marquee-bullets/check-bullet/ax-uc1", - "icon-bullet": "N/A", - "card-list": "/fragments/uar/cross-sell/card-list", - "commerce-card": "/fragments/uar/cross-sell/commerce-cards/cci", - "plan-card": "N/A", - "learn": "/fragments/uar/learn/learn-express", - "ff-banner": "/fragments/uar/banners/firefly", - "value-prop": "N/A", - "social-blade": "/fragments/uar/express-social/individual", - "legal-copy": "N/A" - }, - { - "product": "fi-ax_ste", - "marquee": "/fragments/uar/marquee/ccx", - "marquee-plan": "/fragments/uar/marquee/marquee-plan/ccx-ste", - "check-bullet": "/fragments/uar/marquee/marquee-bullets/check-bullet/ax-ste1", - "icon-bullet": "N/A", - "card-list": "/fragments/uar/cross-sell/card-list", - "commerce-card": "/fragments/uar/cross-sell/commerce-cards/cci-ste", - "plan-card": "N/A", - "learn": "/fragments/uar/learn/learn-express", - "ff-banner": "/fragments/uar/banners/firefly-ste", - "value-prop": "N/A", - "social-blade": "/fragments/uar/express-social/students", - "legal-copy": "N/A" - }, - { - "product": "fi-ax_smb", - "marquee": "/fragments/uar/marquee/ccx", - "marquee-plan": "/fragments/uar/marquee/marquee-plan/ccx-cct", - "check-bullet": "/fragments/uar/marquee/marquee-bullets/check-bullet/ax-cct1", - "icon-bullet": "N/A", - "card-list": "/fragments/uar/cross-sell/card-list", - "commerce-card": "/fragments/uar/cross-sell/commerce-cards/cci-cct", - "plan-card": "N/A", - "learn": "/fragments/uar/learn/learn-express", - "ff-banner": "/fragments/uar/banners/firefly-cct", - "value-prop": "N/A", - "social-blade": "/fragments/uar/express-social/teams", - "legal-copy": "N/A" - } - ] - }, - "result-destination": { - "total": 9, - "offset": 0, - "limit": 9, - "data": [ - { - "result": "(fi-ax_indiv)", - "umbrella-result": "", - "url": "/drafts/quiz/plan-recommender-var/quiz-results", - "basic-fragments": "marquee,card-list,social-blade,ff-banner,learn", - "nested-fragments-primary": "check-bullet,marquee-plan", - "nested-fragments-secondary": "commerce-card" - }, - { - "result": "(fi-ax_ste)", - "umbrella-result": "", - "url": "/drafts/quiz/plan-recommender-var/quiz-results", - "basic-fragments": "marquee,card-list,social-blade,learn", - "nested-fragments-primary": "check-bullet,marquee-plan", - "nested-fragments-secondary": "commerce-card" - }, - { - "result": "(fi-ax_smb)", - "umbrella-result": "", - "url": "/drafts/quiz/plan-recommender-var/quiz-results", - "basic-fragments": "marquee,card-list,social-blade,ff-banner,learn", - "nested-fragments-primary": "check-bullet,marquee-plan", - "nested-fragments-secondary": "commerce-card" - }, - { - "result": "(fi-ax_indiv,pr_indiv,ae_indiv,an_indiv,au_indiv,id_indiv,ai_indiv,ps_indiv,pdf_indiv,lr_indiv,st_indiv,pt_indiv,sa_indiv,md_indiv,ds_indiv)&(fi-ax_indiv,pr_indiv,ae_indiv,an_indiv,au_indiv,id_indiv,ai_indiv,ps_indiv,pdf_indiv,lr_indiv,st_indiv,pt_indiv,sa_indiv,md_indiv,ds_indiv)", - "umbrella-result": "open-text-ax_indiv", - "url": "/drafts/quiz/plan-recommender-var/quiz-results", - "basic-fragments": "marquee,card-list,social-blade,ff-banner,learn", - "nested-fragments-primary": "check-bullet,marquee-plan", - "nested-fragments-secondary": "commerce-card" - }, - { - "result": "(fi-ax_ste,pr_ste,ae_ste,an_ste,au_ste,id_ste,ai_ste,ps_ste,pdf_ste,lr_ste,st_ste,pt_ste,sa_ste,md_ste,ds_ste)&(fi-ax_ste,pr_ste,ae_ste,an_ste,au_ste,id_ste,ai_ste,ps_ste,pdf_ste,lr_ste,st_ste,pt_ste,sa_ste,md_ste,ds_ste)", - "umbrella-result": "open-text-ax_ste", - "url": "/drafts/quiz/plan-recommender-var/quiz-results", - "basic-fragments": "marquee,card-list,social-blade,learn", - "nested-fragments-primary": "check-bullet,marquee-plan", - "nested-fragments-secondary": "commerce-card" - }, - { - "result": "(fi-ax_smb,pr_smb,ae_smb,an_smb,au_smb,id_smb,ai_smb,ps_smb,pdf_smb,lr_smb,st_smb,pt_smb,sa_smb,md_smb,ds_smb,smb,smb)&(fi-ax_smb,pr_smb,ae_smb,an_smb,au_smb,id_smb,ai_smb,ps_smb,pdf_smb,lr_smb,st_smb,pt_smb,sa_smb,md_smb,ds_smb,smb,smb)", - "umbrella-result": "open-text-ax_smb", - "url": "/drafts/quiz/plan-recommender-var/quiz-results", - "basic-fragments": "marquee,card-list,social-blade,ff-banner,learn", - "nested-fragments-primary": "check-bullet,marquee-plan", - "nested-fragments-secondary": "commerce-card" - }, - { - "result": "(fi-ax_indiv,pr_indiv,ae_indiv,an_indiv,au_indiv,id_indiv,ai_indiv,ps_indiv,pdf_indiv,lr_indiv,st_indiv,pt_indiv,sa_indiv,md_indiv,ds_indiv)&(fi-ax_indiv,pr_indiv,ae_indiv,an_indiv,au_indiv,id_indiv,ai_indiv,ps_indiv,pdf_indiv,lr_indiv,st_indiv,pt_indiv,sa_indiv,md_indiv,ds_indiv)&(fi-ax_indiv,pr_indiv,ae_indiv,an_indiv,au_indiv,id_indiv,ai_indiv,ps_indiv,pdf_indiv,lr_indiv,st_indiv,pt_indiv,sa_indiv,md_indiv,ds_indiv)", - "umbrella-result": "open-text-ax_indiv", - "url": "/drafts/quiz/plan-recommender-var/quiz-results", - "basic-fragments": "marquee,card-list,social-blade,ff-banner,learn", - "nested-fragments-primary": "check-bullet,marquee-plan", - "nested-fragments-secondary": "commerce-card" - }, - { - "result": "(fi-ax_ste,pr_ste,ae_ste,an_ste,au_ste,id_ste,ai_ste,ps_ste,pdf_ste,lr_ste,st_ste,pt_ste,sa_ste,md_ste,ds_ste)&(fi-ax_ste,pr_ste,ae_ste,an_ste,au_ste,id_ste,ai_ste,ps_ste,pdf_ste,lr_ste,st_ste,pt_ste,sa_ste,md_ste,ds_ste)&(fi-ax_ste,pr_ste,ae_ste,an_ste,au_ste,id_ste,ai_ste,ps_ste,pdf_ste,lr_ste,st_ste,pt_ste,sa_ste,md_ste,ds_ste)", - "umbrella-result": "open-text-ax_ste", - "url": "/drafts/quiz/plan-recommender-var/quiz-results", - "basic-fragments": "marquee,card-list,social-blade,learn", - "nested-fragments-primary": "check-bullet,marquee-plan", - "nested-fragments-secondary": "commerce-card" - }, - { - "result": "(fi-ax_smb,pr_smb,ae_smb,an_smb,au_smb,id_smb,ai_smb,ps_smb,pdf_smb,lr_smb,st_smb,pt_smb,sa_smb,md_smb,ds_smb,smb,smb)&(fi-ax_smb,pr_smb,ae_smb,an_smb,au_smb,id_smb,ai_smb,ps_smb,pdf_smb,lr_smb,st_smb,pt_smb,sa_smb,md_smb,ds_smb,smb,smb)&(fi-ax_smb,pr_smb,ae_smb,an_smb,au_smb,id_smb,ai_smb,ps_smb,pdf_smb,lr_smb,st_smb,pt_smb,sa_smb,md_smb,ds_smb,smb,smb)", - "umbrella-result": "open-text-ax_smb", - "url": "/drafts/quiz/plan-recommender-var/quiz-results", - "basic-fragments": "marquee,card-list,social-blade,ff-banner,learn", - "nested-fragments-primary": "check-bullet,marquee-plan", - "nested-fragments-secondary": "commerce-card" - } - ] - }, - ":version": 3, - ":names": [ - "result", - "result-fragments", - "result-destination" - ], - ":type": "multi-sheet" -} diff --git a/test/blocks/quiz-entry/mocks/strings.json b/test/blocks/quiz-entry/mocks/strings.json deleted file mode 100644 index 4b6b7635cc..0000000000 --- a/test/blocks/quiz-entry/mocks/strings.json +++ /dev/null @@ -1,506 +0,0 @@ -{ - "q-video": { - "total": 5, - "offset": 0, - "limit": 5, - "data": [ - { - "options": "social", - "title": "", - "text": "Create, edit, and share on social", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/1-PR-CreateEditShare.png" - }, - { - "options": "pro", - "title": "", - "text": "Make pro-level edits for high-quality results", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/2-PR-ProLevelEdits.png" - }, - { - "options": "movement", - "title": "", - "text": "Create graphics and transitions that move", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/3-AE-TitlesAndTransitions.png" - }, - { - "options": "animate", - "title": "", - "text": "Make animations for cartoons or games", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/4-AN-Animations.png" - }, - { - "options": "sound", - "title": "", - "text": "Edit, mix, and add sound effects", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/5-AU-SoundEffects.png" - } - ] - }, - "q-3d": { - "total": 5, - "offset": 0, - "limit": 5, - "data": [ - { - "options": "stage", - "title": "", - "text": "Assemble, stage, and render 3D scenes", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/3-Stager@1x.png" - }, - { - "options": "texture", - "title": "", - "text": "Texture 3D assets in real time", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/2-Painter@1x.png" - }, - { - "options": "materials", - "title": "", - "text": "Create 3D materials from real-life images", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/5-Sampler@1x.png" - }, - { - "options": "model", - "title": "", - "text": "Create 3D models with digital clay", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/1-Modeler@1x.png" - }, - { - "options": "assets", - "title": "", - "text": "Design 3D assets and materials", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/4-Designer@1x.png" - } - ] - }, - "q-category": { - "total": 7, - "offset": 0, - "limit": 7, - "data": [ - { - "options": "fi_code", - "title": "Describe your interest here", - "text": "Ask our AI assistant", - "icon": "https://milo.adobe.com/drafts/quiz/quiz-ai/search.svg", - "image": "" - }, - { - "options": "photo", - "title": "Photography", - "text": "Edit or organize my photos", - "icon": "", - "image": "https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/photography.png" - }, - { - "options": "video", - "title": "Video", - "text": "Create and edit video or audio", - "icon": "", - "image": "https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/video.png" - }, - { - "options": "design", - "title": "Graphic design", - "text": "Design layouts or websites", - "icon": "", - "image": "https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/design.png" - }, - { - "options": "illustration", - "title": "Illustration", - "text": "Paint, draw, or create illustrations", - "icon": "", - "image": "https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/illustration.png" - }, - { - "options": "pdf", - "title": "PDFs", - "text": "Create, edit, or sign PDFs", - "icon": "", - "image": "https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/pdf.png" - }, - { - "options": "3d", - "title": "3D/AR", - "text": "Model, texture, and render 3D assets and scenes", - "icon": "", - "image": "https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/3dar.png" - } - ] - }, - "questions": { - "total": 10, - "offset": 0, - "limit": 10, - "data": [ - { - "q": "q-category", - "heading": "Not sure which apps are best for you?", - "sub-head": "Tell us what you’re interested in. We’ll help you figure it out.", - "btn": "Continue", - "text": "Or pick up to 3 below", - "background": "https://milo.adobe.com/drafts/quiz/quiz-2/quiz-background.jpeg", - "footerFragment": "" - }, - { - "q": "q-fallback", - "heading": "We're sorry our assistant couldn't help today.", - "sub-head": "Please choose up to three options.", - "btn": "Next", - "text": "", - "background": "https://milo.adobe.com/drafts/quiz/quiz-2/quiz-background.jpeg", - "footerFragment": "" - }, - { - "q": "q-photo", - "heading": "What do you want to do with photos?", - "sub-head": "Pick one.", - "btn": "Next", - "text": "", - "background": "https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Photo%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920", - "footerFragment": "https://milo.adobe.com/fragments/quiz/sample-uar-fragments/footer/footer1" - }, - { - "q": "q-video", - "heading": "What do you want to do with video?", - "sub-head": "Pick one.", - "btn": "Next", - "text": "", - "background": "https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Photo%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920", - "footerFragment": "" - }, - { - "q": "q-design", - "heading": "What do you want to do with design?", - "sub-head": "Pick one.", - "btn": "Next", - "text": "", - "background": "https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Design%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920", - "footerFragment": "" - }, - { - "q": "q-illustration", - "heading": "What do you want to do with illustration?", - "sub-head": "Pick one.", - "btn": "Next", - "text": "", - "background": "https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Illustration%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920", - "footerFragment": "" - }, - { - "q": "q-pdf", - "heading": "What do you want to do with PDFs?", - "sub-head": "Pick one.", - "btn": "Next", - "text": "", - "background": "https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Acrobat%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920", - "footerFragment": "" - }, - { - "q": "q-3d", - "heading": "What do you want to do with 3D/AR?", - "sub-head": "Pick one.", - "btn": "Next", - "text": "", - "background": "https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-3D-AR%20BKGD?$pjpeg$&jpegSize=300&wid=1920", - "footerFragment": "" - }, - { - "q": "q-rather", - "heading": "For your projects, would you rather:", - "sub-head": "Pick one.", - "btn": "Next", - "text": "", - "background": "https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q3-Learn%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920", - "footerFragment": "" - }, - { - "q": "q-customer", - "heading": "What else are you looking for today?", - "sub-head": "Pick one.", - "btn": "Get your results", - "text": "", - "background": "https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q4%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920", - "footerFragment": "https://milo.adobe.com/fragments/quiz/sample-uar-fragments/footer/footer2" - } - ] - }, - "q-rather": { - "total": 2, - "offset": 0, - "limit": 2, - "data": [ - { - "options": "template", - "title": "", - "text": "Edit quickly and customize templates", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/1-Templates.png" - }, - { - "options": "custom", - "title": "", - "text": "Take the time to control every detail", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/2-CustomDesigns.png" - } - ] - }, - "q-photo": { - "total": 5, - "offset": 0, - "limit": 5, - "data": [ - { - "options": "organize", - "title": "", - "text": "Get them sorted and organized", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/1-LR-StoreAndOrganize.png" - }, - { - "options": "batch", - "title": "", - "text": "Edit lots of photos quickly", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/2-LR-ApplyFilters.png" - }, - { - "options": "edit", - "title": "", - "text": "Edit and finesse the smallest details", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/3-PS-RemoveObjects.png" - }, - { - "options": "color", - "title": "", - "text": "Correct color and lighting like a pro", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/4-PS-MakeDetailedColor.png" - }, - { - "options": "blend", - "title": "", - "text": "Blend multiple shots into something new", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/5-PS-BlendImages.png" - } - ] - }, - "q-fallback": { - "total": 6, - "offset": 0, - "limit": 6, - "data": [ - { - "options": "photo", - "title": "Photography", - "text": "Edit or organize my photos", - "icon": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/1-Photo%20ICON.svg", - "image": "" - }, - { - "options": "video", - "title": "Video", - "text": "Create and edit video or audio", - "icon": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/2-Video%20ICON.svg", - "image": "" - }, - { - "options": "design", - "title": "Graphic design", - "text": "Design layouts or websites", - "icon": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/3-Design%20ICON.svg", - "image": "" - }, - { - "options": "illustration", - "title": "Illustration", - "text": "Paint, draw, or create illustrations", - "icon": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/4-Illustration%20ICON.svg", - "image": "" - }, - { - "options": "pdf", - "title": "PDFs", - "text": "Create, edit, or sign PDFs", - "icon": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/5-PDF%20ICON.svg", - "image": "" - }, - { - "options": "3d", - "title": "3D/AR", - "text": "Model, texture, and render 3D assets and scenes", - "icon": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/6-3D-AR%20ICON.svg", - "image": "" - } - ] - }, - "q-pdf": { - "total": 6, - "offset": 0, - "limit": 6, - "data": [ - { - "options": "create", - "title": "", - "text": "Create and export PDFs to Office", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/1-Ac-CreateExport.png" - }, - { - "options": "edit", - "title": "", - "text": "Edit text and images in PDFs", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/2-Ac-EditText.png" - }, - { - "options": "share", - "title": "", - "text": "Share PDFs with anyone", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/3-Ac-Share.png" - }, - { - "options": "secure", - "title": "", - "text": "Protect and secure PDFs", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/4-Ac-Protect.png" - }, - { - "options": "sign", - "title": "", - "text": "Sign PDFs wherever you are", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/5-Ac-Sign.png" - }, - { - "options": "track", - "title": "", - "text": "Track signatures and progress", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/6-Ac-TrackSignatures.png" - } - ] - }, - "q-design": { - "total": 3, - "offset": 0, - "limit": 3, - "data": [ - { - "options": "layouts", - "title": "", - "text": "Create layouts for magazines, books, or posters", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-design/1-%20Id-Layouts.png" - }, - { - "options": "images", - "title": "", - "text": "Combine multiple images into new designs", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-design/2-PS-CombineImages.png" - }, - { - "options": "graphics", - "title": "", - "text": "Create graphics and designs that work at any size", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-design/3-Ai-CreateGraphics.png" - } - ] - }, - "q-illustration": { - "total": 4, - "offset": 0, - "limit": 4, - "data": [ - { - "options": "raster", - "title": "", - "text": "Paint, draw, or doodle like on paper", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-illustration/1-PS-PaintDraw.png" - }, - { - "options": "vector", - "title": "", - "text": "Make illustrations that work at any size", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-illustration/2-Ai-WorkAtAnySize.png" - }, - { - "options": "crisp", - "title": "", - "text": "Draw crisp lines and smooth curves", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-illustration/3-Ai-CrispLines.png" - }, - { - "options": "images", - "title": "", - "text": "Blend multiple images into something new", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-illustration/4-PS-BlendImages.png" - } - ] - }, - "q-customer": { - "total": 3, - "offset": 0, - "limit": 3, - "data": [ - { - "options": "educational", - "title": "", - "text": "A student or teacher discount", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q4/2-StudentTeacher.png" - }, - { - "options": "business", - "title": "", - "text": "Licenses and business features for teams", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q4/3-Work.png" - }, - { - "options": "individual", - "title": "", - "text": "Neither apply", - "icon": "", - "image": "https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q4/1-Individual.png" - } - ] - }, - ":version": 3, - ":names": [ - "q-video", - "q-3d", - "q-category", - "questions", - "q-rather", - "q-photo", - "q-fallback", - "q-pdf", - "q-design", - "q-illustration", - "q-customer" - ], - ":type": "multi-sheet" -} diff --git a/test/blocks/quiz-entry/quiz-entry.test.js b/test/blocks/quiz-entry/quiz-entry.test.js deleted file mode 100644 index 8a3ac889e9..0000000000 --- a/test/blocks/quiz-entry/quiz-entry.test.js +++ /dev/null @@ -1,314 +0,0 @@ -/* eslint-disable no-promise-executor-return */ -import { readFile } from '@web/test-runner-commands'; -import { expect } from '@esm-bundle/chai'; -import sinon from 'sinon'; -import init from '../../../libs/blocks/quiz-entry/quiz-entry.js'; -import { getSuggestions } from '../../../libs/blocks/quiz-entry/quizPopover.js'; - -let fetchStub; -let quizEntryElement; -const { default: mockData } = await import('./mocks/mock-data.js'); -const mockQuestionsData = mockData.questions; -const mockStringsData = mockData.strings; -const quizConfig = { - quizPath: '/drafts/quiz/quiz-entry/', - maxQuestions: 1, - analyticsQuiz: 'clientv1', - analyticsType: 'cc:app-test', - questionData: mockQuestionsData, - stringsData: mockStringsData, -}; - -describe('Quiz Entry Component', () => { - beforeEach(async () => { - window.lana = { log: sinon.stub() }; - fetchStub = sinon.stub(window, 'fetch'); - fetchStub.resolves({ - ok: true, - json: () => Promise.resolve({ suggested_completions: ['designer desk', 'design logos'] }), - }); - document.body.innerHTML = await readFile({ path: './mocks/index.html' }); - quizEntryElement = document.querySelector('.quiz-entry'); - await init(quizEntryElement, quizConfig); - await new Promise((resolve) => setTimeout(resolve, 100)); - }); - - afterEach(() => { - sinon.restore(); - }); - - it('should trigger onMLInput and update suggestions', async () => { - const mlInputField = document.querySelector('#quiz-input'); - const testInput = 'design'; - const inputEvent = new Event('input', { bubbles: true }); - mlInputField.value = testInput; - mlInputField.dispatchEvent(inputEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - const popoverContainer = document.querySelector('.popover-container'); - const suggestionItems = popoverContainer.querySelectorAll('.popover-item'); - expect(suggestionItems).to.exist; - }); - - it('Should trigger popover content on click', async () => { - const mlInputField = document.querySelector('#quiz-input'); - const testInput = 'design'; - const inputEvent = new Event('input', { bubbles: true }); - mlInputField.value = testInput; - mlInputField.dispatchEvent(inputEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - const popoverItem = document.querySelector('.popover-item'); - popoverItem.innerHTML = 'design a logo'; - popoverItem.click(); - await new Promise((resolve) => setTimeout(resolve, 100)); - const enterKeyEvent = new KeyboardEvent('keypress', { - key: 'Enter', - code: 'Enter', - keyCode: 13, - }); - mlInputField.dispatchEvent(enterKeyEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - mlInputField.value = 'design a logo'; - expect(mlInputField.value).to.equal('design a logo'); - }); - - it('should fetch suggestions and return data on successful response', async () => { - const mockApiResponse = { - ok: true, - json: () => Promise.resolve({ suggested_completions: ['suggestion1', 'suggestion2'] }), - }; - fetchStub.resolves(mockApiResponse); - const result = await getSuggestions('test-endpoint', 'test-client-id', 'query', 'test-scope'); - expect(fetchStub.calledOnce).to.be.true; - expect(result).to.deep.equal({ suggested_completions: ['suggestion1', 'suggestion2'] }); - const expectedUrl = 'https://adobesearch.adobe.io/test-endpoint/completions?q[text]=query&q[locale]=en_us&scope=test-scope'; - expect(fetchStub.calledWith(expectedUrl, { - method: 'GET', - headers: { 'x-api-key': 'test-client-id' }, - })).to.be.true; - }); - - it('should handle failed fetch attempts', async () => { - fetchStub.resolves({ ok: false }); - const result = await getSuggestions('test-endpoint', 'test-client-id', 'query', 'test-scope'); - expect(fetchStub.calledOnce).to.be.true; - expect(result).to.equal(''); - }); - - it('should initialize with provided element and display the quiz', async () => { - expect(quizEntryElement.innerHTML).to.include('quiz-container'); - }); - - it('should handle user interaction and update selection state', async () => { - const option = quizEntryElement.querySelector('.quiz-option'); - option.click(); - await new Promise((resolve) => setTimeout(resolve, 100)); - expect(option.classList.contains('selected')).to.be.true; - }); - - it('1 should trigger continueQuiz on enter key press', async () => { - const mlFieldInput = document.querySelector('#quiz-input'); - const enterKeyEvent = new KeyboardEvent('keypress', { - key: 'Enter', - code: 'Enter', - keyCode: 13, - }); - mlFieldInput.dispatchEvent(enterKeyEvent); - }); - - it('should clear the input field on clear button click', async () => { - const mlFieldInput = document.querySelector('#quiz-input'); - const clearButton = document.querySelector('#quiz-input-clear'); - mlFieldInput.value = 'test'; - clearButton.click(); - expect(mlFieldInput.value).to.equal(''); - }); - it('should have an input focus() on suggestion click', async () => { - const mlFieldInput = document.querySelector('#quiz-input'); - mlFieldInput.value = 'design a logo'; - const inputEvent = new Event('input', { bubbles: true }); - mlFieldInput.dispatchEvent(inputEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - const suggestionItem = document.querySelector('.popover-item'); - suggestionItem.click(); - expect(mlFieldInput).to.equal(document.activeElement); - }); - it('should have the selected class after clicking on an option', async () => { - const option = document.querySelector('.quiz-option'); - option.click(); - await new Promise((resolve) => setTimeout(resolve, 100)); - expect(option.classList.contains('selected')).to.be.true; - }); - it('should remove the selected class after clicking on the .quiz-option element again', async () => { - const option = document.querySelector('.quiz-option'); - option.click(); - await new Promise((resolve) => setTimeout(resolve, 100)); - option.click(); - await new Promise((resolve) => setTimeout(resolve, 100)); - expect(option.classList.contains('selected')).to.be.false; - }); - it('continue should be available after mlfield is used', async () => { - const mlFieldInput = document.querySelector('#quiz-input'); - const continueButton = document.querySelector('.quiz-button'); - mlFieldInput.value = 'design a logo'; - const inputEvent = new Event('input', { bubbles: true }); - mlFieldInput.dispatchEvent(inputEvent); - continueButton.click(); - await new Promise((resolve) => setTimeout(resolve, 100)); - expect(continueButton.classList.contains('disabled')).to.be.false; - }); - it('should navigate the carousel using keyboard commands', async () => { - const options = document.querySelectorAll('.quiz-option'); - const option = document.querySelector('.quiz-option'); - option.click(); - await new Promise((resolve) => setTimeout(resolve, 100)); - const carousel = document.querySelector('.quiz-options-container'); - const rightArrowEvent = new KeyboardEvent('keydown', { key: 'ArrowRight' }); - const leftArrowEvent = new KeyboardEvent('keydown', { key: 'ArrowLeft' }); - carousel.dispatchEvent(rightArrowEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - carousel.dispatchEvent(leftArrowEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - const leftArrow = document.querySelector('.carousel-arrow.arrow-prev'); - expect(leftArrow).to.not.exist; - - const tabKeyEvent = new KeyboardEvent('keydown', { key: 'Tab' }); - option.dispatchEvent(tabKeyEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - expect(option.classList.contains('selected')).to.be.true; - - const spaceKeyEvent = new KeyboardEvent('keydown', { key: ' ', keyCode: 32 }); - carousel.dispatchEvent(spaceKeyEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - - const enterKeyEvent = new KeyboardEvent('keydown', { - key: 'Enter', - code: 'Enter', - keyCode: 13, - }); - carousel.dispatchEvent(enterKeyEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - expect(options[1].classList.contains('selected')).to.be.false; - }); - it('should handle error and return default data if fetching quiz data fails', async () => { - // Stubbing console.error to suppress error logs in tests - const consoleErrorStub = sinon.stub(console, 'error'); - - fetchStub.rejects(new Error('Failed to load quiz data')); - - await init(quizEntryElement, {}); - - expect(fetchStub.calledOnceWith(quizEntryElement)).to.be.false; - expect(consoleErrorStub.calledOnce).to.be.true; - expect(consoleErrorStub.args[0][0]).to.equal('Failed to load quiz data:'); - }); -}); - -describe('RTL Quiz Entry', () => { - beforeEach(async () => { - window.lana = { log: sinon.stub() }; - fetchStub = sinon.stub(window, 'fetch'); - fetchStub.resolves({ - ok: true, - json: () => Promise.resolve({ suggested_completions: ['designer desk', 'design logos'] }), - }); - document.body.innerHTML = await readFile({ path: './mocks/index.html' }); - document.documentElement.setAttribute('dir', 'rtl'); - quizEntryElement = document.querySelector('.quiz-entry'); - await init(quizEntryElement, quizConfig); - await new Promise((resolve) => setTimeout(resolve, 100)); - }); - - afterEach(() => { - sinon.restore(); - }); - - it('should navigate the carousel using keyboard commands', async () => { - const options = document.querySelectorAll('.quiz-option'); - const option = document.querySelector('.quiz-option'); - option.click(); - await new Promise((resolve) => setTimeout(resolve, 100)); - const carousel = document.querySelector('.quiz-options-container'); - const rightArrowEvent = new KeyboardEvent('keydown', { key: 'ArrowRight' }); - const leftArrowEvent = new KeyboardEvent('keydown', { key: 'ArrowLeft' }); - carousel.dispatchEvent(rightArrowEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - carousel.dispatchEvent(leftArrowEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - const leftArrow = document.querySelector('.carousel-arrow.arrow-prev'); - expect(leftArrow).to.exist; - - const tabKeyEvent = new KeyboardEvent('keydown', { key: 'Tab' }); - option.dispatchEvent(tabKeyEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - expect(option.classList.contains('selected')).to.be.false; - - const spaceKeyEvent = new KeyboardEvent('keydown', { key: ' ', keyCode: 32 }); - carousel.dispatchEvent(spaceKeyEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - - const enterKeyEvent = new KeyboardEvent('keydown', { - key: 'Enter', - code: 'Enter', - keyCode: 13, - }); - carousel.dispatchEvent(enterKeyEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - expect(options[1].classList.contains('selected')).to.be.false; - }); -}); - -describe('ML Result Trigger', () => { - beforeEach(async () => { - window.lana = { log: sinon.stub() }; - fetchStub = sinon.stub(window, 'fetch'); - const mockApiResponse = { - statusCode: 200, - data: { - data: [ - { - ficode: 'illustrator_cc', - prob: '0.33', - }, - { - ficode: 'indesign_cc', - prob: '0.27', - }, - { - ficode: 'free_spark', - prob: '0.22', - }, - ], - jobName: '', - }, - }; - fetchStub.resolves({ - ok: true, - json: () => Promise.resolve(mockApiResponse.data), - }); - document.body.innerHTML = await readFile({ path: './mocks/index.html' }); - quizEntryElement = document.querySelector('.quiz-entry'); - await init(quizEntryElement, quizConfig); - await new Promise((resolve) => setTimeout(resolve, 100)); - }); - - afterEach(() => { - sinon.restore(); - }); - - it('Should trigger results fetching scenario', async () => { - const mlInputField = document.querySelector('#quiz-input'); - const testInput = 'design'; - const inputEvent = new Event('input', { bubbles: true }); - mlInputField.value = testInput; - mlInputField.dispatchEvent(inputEvent); - await new Promise((resolve) => setTimeout(resolve, 100)); - - const enterKeyEvent = new KeyboardEvent('keypress', { - key: 'Enter', - code: 'Enter', - keyCode: 13, - }); - mlInputField.dispatchEvent(enterKeyEvent); - expect(mlInputField.value).to.equal('design'); - }); -}); diff --git a/test/blocks/quiz-entry/utils.test.js b/test/blocks/quiz-entry/utils.test.js deleted file mode 100644 index a81e6d5c3b..0000000000 --- a/test/blocks/quiz-entry/utils.test.js +++ /dev/null @@ -1,248 +0,0 @@ -/* eslint-disable no-promise-executor-return */ -import { readFile } from '@web/test-runner-commands'; -import { expect } from '@esm-bundle/chai'; -import sinon from 'sinon'; -import { handleNext, getQuizJson, handleSelections, getQuizEntryData } from '../../../libs/blocks/quiz-entry/utils.js'; // Correct the path as needed - -let fetchStub; -const path = './mocks/'; -const { default: mockData } = await import('./mocks/mock-data.js'); -const mockQuestionsData = mockData.questions; -const mockStringsData = mockData.strings; -const mockResultsData = mockData.results; -const quizConfig = { - quizPath: '/drafts/quiz/', - maxQuestions: 1, - analyticsQuiz: 'uarv4', - analyticsType: 'cc:app-reco', - questionData: undefined, - stringsData: undefined, - resultsData: undefined, -}; -const selectedQuestion = { - questions: 'q-category', - 'max-selections': '3', - 'min-selections': '1', -}; -const userInputSelections = { photo: true }; -const userInputSelectionsNot = { '3d': true }; -const userInputSelectionsReset = { video: true }; - -const userFlow = []; -const nextFlow = { nextFlow: ['q-rather', 'q-photo'] }; -const nextFlowNot = { nextFlow: ['q-3d'] }; -const nextFlowReset = { nextFlow: [] }; -const prevSelections = []; -const selections = ['photo']; -const nextSelectionsExpected = { - nextSelections: [ - { - selectedCards: [ - 'photo', - ], - selectedQuestion: { - 'max-selections': '3', - 'min-selections': '1', - questions: 'q-category', - }, - }, - ], -}; - -describe('Quiz Entry Utils', () => { - beforeEach(async () => { - window.lana = { log: sinon.stub() }; - fetchStub = sinon.stub(window, 'fetch'); - fetchStub.withArgs(`${path}questions.json`).resolves({ - ok: true, - json: () => Promise.resolve(mockQuestionsData), - }); - fetchStub.withArgs(`${path}strings.json`).resolves({ - ok: true, - json: () => Promise.resolve(mockStringsData), - }); - fetchStub.withArgs(`${path}results.json`).resolves({ - ok: true, - json: () => Promise.resolve(mockResultsData), - }); - - // Handling non-existent results.json - fetchStub.withArgs(`${path}non-existent.json`).resolves({ - ok: false, - status: 404, - json: () => Promise.reject(new Error('File not found')), - }); - }); - - afterEach(() => { - sinon.restore(); - }); - - it('should handle the next flow of questions', async () => { - const nextQuestion = handleNext( - mockQuestionsData, - selectedQuestion, - userInputSelections, - userFlow, - ); - expect(nextQuestion).to.deep.equal(nextFlow); - }); - - it('should handle the next flow of questions with not()', async () => { - const nextQuestion = handleNext( - mockQuestionsData, - selectedQuestion, - userInputSelectionsNot, - userFlow, - ); - expect(nextQuestion).to.deep.equal(nextFlowNot); - }); - - it('should handle the next flow of questions with reset()', async () => { - const nextQuestion = handleNext( - mockQuestionsData, - selectedQuestion, - userInputSelectionsReset, - userFlow, - ); - expect(nextQuestion).to.deep.equal(nextFlowReset); - }); - - it('should fetch quiz data', async () => { - const [questions, strings, results] = await getQuizJson(path); - - // Check if fetch was called with the correct paths - sinon.assert.calledWith(fetchStub, `${path}questions.json`); - sinon.assert.calledWith(fetchStub, `${path}strings.json`); - sinon.assert.calledWith(fetchStub, `${path}results.json`); - - // Check that each fetch was called once - sinon.assert.calledOnce(fetchStub.withArgs(`${path}questions.json`)); - sinon.assert.calledOnce(fetchStub.withArgs(`${path}strings.json`)); - sinon.assert.calledOnce(fetchStub.withArgs(`${path}results.json`)); - - // Assertions for the returned data - expect(questions).to.deep.equal(mockQuestionsData); - expect(strings).to.deep.equal(mockStringsData); - expect(results).to.deep.equal(mockResultsData); - }); - - it('should handle missing results.json gracefully', async () => { - fetchStub.withArgs(`${path}results.json`).resolves({ - ok: false, - status: 404, - json: () => Promise.reject(new Error('File not found')), - }); - - const [questions, strings, results] = await getQuizJson(path); - - // Check fetch calls - sinon.assert.calledWith(fetchStub, `${path}questions.json`); - sinon.assert.calledWith(fetchStub, `${path}strings.json`); - sinon.assert.calledWith(fetchStub, `${path}results.json`); - - // Assertions for the returned data, results should be empty - expect(questions).to.deep.equal(mockQuestionsData); - expect(strings).to.deep.equal(mockStringsData); - expect(results).to.deep.equal([]); - }); - - it('should log an error when fetching fails', async () => { - fetchStub.withArgs(`${path}questions.json`).resolves({ - ok: false, - status: 500, - json: () => Promise.reject(new Error('Internal server error')), - }); - - const result = await getQuizJson(path); - - // Ensure fetch was called with the correct path - sinon.assert.calledWith(fetchStub, `${path}questions.json`); - - // Result should be empty due to the error - expect(result).to.deep.equal([]); - - // Check that lana.log was called with the error message - sinon.assert.calledWith( - window.lana.log, - 'ERROR: Fetching data for quiz entry: Error: Internal server error', - ); - }); - - it('should log an info message when results.json is missing', async () => { - fetchStub.withArgs(`${path}results.json`).resolves({ - ok: false, - status: 404, - json: () => Promise.reject(new Error('File not found')), - }); - - const [questions, strings, results] = await getQuizJson(path); - - // Check fetch calls - sinon.assert.calledWith(fetchStub, `${path}questions.json`); - sinon.assert.calledWith(fetchStub, `${path}strings.json`); - sinon.assert.calledWith(fetchStub, `${path}results.json`); - - // Assertions for the returned data - expect(questions).to.deep.equal(mockQuestionsData); - expect(strings).to.deep.equal(mockStringsData); - expect(results).to.deep.equal([]); - - // Check that lana.log was called with the info message - sinon.assert.calledWith( - window.lana.log, - "INFO: results.json not found or couldn't be fetched: Error: File not found", - ); - }); -}); - -describe('Quiz Entry Utils failed request', () => { - beforeEach(async () => { - window.lana = { log: sinon.stub() }; - fetchStub = sinon.stub(window, 'fetch'); - fetchStub.resolves({ ok: false }); - }); - - afterEach(() => { - sinon.restore(); - }); - - it('should log an error when fetching quiz data fails', async () => { - await getQuizJson('./mocks/'); - expect(window.lana.log.called).to.be.true; - }); - it('should return nextSelections on handleSelections', async () => { - const nextSelections = handleSelections(prevSelections, selectedQuestion, selections); - expect(nextSelections).to.deep.equal(nextSelectionsExpected); - }); - - it('should de-dup any existing data if they use the ml field and cards.', async () => { - const prevSelectionsLength = [{ - selectedQuestion: { - 'max-selections': '3', - 'min-selections': '1', - questions: 'q-category', - }, - }]; - - const selectedQuestionPrev = [{ - selectedQuestion: { - 'max-selections': '3', - 'min-selections': '1', - questions: 'q-category', - }, - }]; - - const nextSelections = handleSelections(prevSelectionsLength, selectedQuestionPrev, selections); - await new Promise((resolve) => setTimeout(resolve, 100)); - expect(nextSelections).to.deep.equal(nextSelections); - }); - - it('should return quizPath, maxQuestions, analyticsQuiz, analyticsType, questionData', async () => { - document.body.innerHTML = await readFile({ path: './mocks/index.html' }); - const el = document.querySelector('.quiz-entry'); - - const quizEntryData = await getQuizEntryData(el); - expect(quizEntryData).to.deep.equal(quizConfig); - }); -}); From 6b7943b0821ce25a7db91a158f949f918da5707a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Kosanovi=C4=87?= Date: Fri, 7 Feb 2025 13:28:27 +0100 Subject: [PATCH 12/13] [MWPW-160510] tooltip enabled on all icons (#3593) * [MWPW-160510] tooltip enabled on all icons * [MWPW-160510] code coverage expanded * [MWPW-160510] tooltip code optimization --- libs/blocks/table/table.css | 14 +++++--------- libs/features/icons/icons.js | 17 +++++++++++------ test/features/icons/icons.test.js | 11 +++++++++++ 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/libs/blocks/table/table.css b/libs/blocks/table/table.css index 60d84fb6b7..1ab66f977a 100644 --- a/libs/blocks/table/table.css +++ b/libs/blocks/table/table.css @@ -331,20 +331,16 @@ margin-left: -4px; } -.table .milo-tooltip svg { - top: unset; -} - -.table .icon-milo-info { +.table span[data-tooltip] .icon-milo { height: 16px; } -.table .icon-info:hover { +.table span[data-tooltip] .icon-milo:hover { cursor: pointer; } -.table .icon-info:hover path, -.table .active .icon-info path { +.table span[data-tooltip] .icon-milo:hover path, +.table span[data-tooltip] .active .icon-milo path { color: var(--hover-border-color); } @@ -517,7 +513,7 @@ } .table.has-addon .addon-label .icon, -.table.has-addon .active .icon-milo-info path { +.table.has-addon span[data-tooltip] .active .icon-milo path { color: black; } diff --git a/libs/features/icons/icons.js b/libs/features/icons/icons.js index 5dfe057844..eb7f74a214 100644 --- a/libs/features/icons/icons.js +++ b/libs/features/icons/icons.js @@ -34,7 +34,10 @@ export const fetchIcons = (config) => new Promise(async (resolve) => { resolve(fetchedIcons); }); -function decorateToolTip(icon) { +function decorateToolTip(icon, iconName) { + const hasTooltip = icon.closest('em')?.textContent.includes('|') && [...icon.classList].some((cls) => cls.includes('tooltip')); + if (!hasTooltip) return; + const wrapper = icon.closest('em'); wrapper.className = 'tooltip-wrapper'; if (!wrapper) return; @@ -45,7 +48,7 @@ function decorateToolTip(icon) { icon.dataset.tooltip = content; // Position is the next to last part of a tooltip const place = conf.pop()?.trim().toLowerCase() || 'right'; - icon.className = `icon icon-info milo-tooltip ${place}`; + icon.className = `icon icon-${iconName} milo-tooltip ${place}`; icon.setAttribute('tabindex', '0'); icon.setAttribute('aria-label', content); icon.setAttribute('role', 'button'); @@ -56,13 +59,15 @@ export default async function loadIcons(icons, config) { const iconSVGs = await fetchIcons(config); if (!iconSVGs) return; icons.forEach(async (icon) => { - const { classList } = icon; - if (classList.contains('icon-tooltip')) decorateToolTip(icon); - const iconName = icon.classList[1].replace('icon-', ''); + const iconNameInitial = icon.classList[1].replace('icon-', ''); + let iconName = iconNameInitial === 'tooltip' ? 'info' : iconNameInitial; + if (iconNameInitial.includes('tooltip-')) iconName = iconNameInitial.replace(/tooltip-/, ''); + decorateToolTip(icon, iconName); + const existingIcon = icon.querySelector('svg'); if (!iconSVGs[iconName] || existingIcon) return; const parent = icon.parentElement; - if (parent.childNodes.length > 1) { + if (parent?.childNodes.length > 1) { if (parent.lastChild === icon) { icon.classList.add('margin-inline-start'); } else if (parent.firstChild === icon) { diff --git a/test/features/icons/icons.test.js b/test/features/icons/icons.test.js index cd355a0aff..2c847a4eae 100644 --- a/test/features/icons/icons.test.js +++ b/test/features/icons/icons.test.js @@ -32,6 +32,17 @@ describe('Icon Suppprt', () => { await loadIcons(icons, config); // Test duplicate icon not created if run twice }); + it('Handles tooltip- prefix correctly', async () => { + const tooltipIcon = createTag('span', { class: 'icon icon-tooltip-info' }); + await loadIcons([tooltipIcon], config); + + const svgIcon = tooltipIcon.querySelector(':scope svg'); + expect(svgIcon).to.exist; + + const iconName = tooltipIcon.classList[1].replace('icon-', '').replace(/tooltip-/, ''); + expect(iconName).to.equal('info'); + }); + it('Fetches successfully with cache control enabled', async () => { const otherIcons = [createTag('span', { class: 'icon icon-play' })]; await loadIcons(otherIcons, config); From 963ffb4edeefaf560549c46366664e2043b042a3 Mon Sep 17 00:00:00 2001 From: Sunil Kamat <107644736+sukamat@users.noreply.github.com> Date: Fri, 7 Feb 2025 08:04:57 -0800 Subject: [PATCH 13/13] MWPW-161920: Fix fragment reference check (#3641) --- tools/floodbox/references.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/floodbox/references.js b/tools/floodbox/references.js index d75fba935f..c5f5884082 100644 --- a/tools/floodbox/references.js +++ b/tools/floodbox/references.js @@ -9,7 +9,7 @@ class References { this.htmlPaths = htmlPaths; // eslint-disable-next-line no-useless-escape - this.referencePattern = new RegExp(`https?:\/\/[^/]*--${repo}--${org}\\.[^/]*(?:page|live)(\/(?:fragments\/.*|.*\\.(?:pdf|svg|json)))`); + this.referencePattern = new RegExp(`https?:\/\/[^/]*--${repo}--${org}\\.[^/]*(?:page|live)(\/.*(?:fragments\/|\\.(?:pdf|svg|json))[^?]*)`); this.requestHandler = new RequestHandler(accessToken); }