From a7b831cb8a3dfdf9ce55793999503c139724b7e7 Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Mon, 20 May 2024 08:48:52 -0700 Subject: [PATCH 1/8] MWPW-147601: sending ML field text to Analytics --- libs/blocks/quiz-entry/quiz-entry.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/libs/blocks/quiz-entry/quiz-entry.js b/libs/blocks/quiz-entry/quiz-entry.js index 327539d8705..dcd55f178bc 100644 --- a/libs/blocks/quiz-entry/quiz-entry.js +++ b/libs/blocks/quiz-entry/quiz-entry.js @@ -55,6 +55,25 @@ const App = ({ return optionItem && optionItem[prop] ? optionItem[prop] : ''; }; + const sendMLFieldTextAnalytics = (fieldText) => { + const val = `Filters|${analyticsType}|${fieldText}`; + + window.alloy('sendEvent', { + documentUnloading: true, + xdm: { + eventType: 'web.webinteraction.linkClicks', + web: { + webInteraction: { + linkClicks: { value: 1 }, + type: 'other', + name: val, + }, + }, + }, + data: { _adobe_corpnew: { digitalData: { search: { searchInfo: { keyword: val } } } } }, + }); + }; + useEffect(() => { (async () => { const qMap = {}; @@ -183,6 +202,8 @@ const App = ({ window.lana.log(`ML results error - ${error}`, { tags: 'errorType=info,module=quiz-entry' }); } + sendMLFieldTextAnalytics(mlFieldText); + if (debug) { if (!fiResults.errors && !fiResults.error_code) { // eslint-disable-next-line no-console @@ -193,6 +214,8 @@ const App = ({ // eslint-disable-next-line no-console console.log('fallback codes used', fallback); } + // eslint-disable-next-line no-console + console.log('sending ML field text to Adobe Analytics: ', `Filters|${analyticsType}|${mlFieldText}`); } } From 67a9cc5a0acd434e00afe0a6ef29ebd5011b18ea Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Tue, 4 Jun 2024 11:03:58 -0700 Subject: [PATCH 2/8] MWPW-147989 and MWPW-151786: handle localized path for quiz spreadsheets and doc files --- libs/blocks/quiz-results/quiz-results.js | 4 +-- libs/blocks/quiz/quiz.js | 3 +- libs/blocks/quiz/utils.js | 25 ++++++++++--- test/blocks/quiz/utils.test.js | 45 ++++++++++++++++++++++-- 4 files changed, 67 insertions(+), 10 deletions(-) diff --git a/libs/blocks/quiz-results/quiz-results.js b/libs/blocks/quiz-results/quiz-results.js index b1c7c3f1595..2abcbe581b5 100644 --- a/libs/blocks/quiz-results/quiz-results.js +++ b/libs/blocks/quiz-results/quiz-results.js @@ -1,6 +1,6 @@ import { createTag, getConfig } from '../../utils/utils.js'; import { handleStyle } from '../section-metadata/section-metadata.js'; -import { getNormalizedMetadata } from '../quiz/utils.js'; +import { getNormalizedMetadata, getLocalizedURL } from '../quiz/utils.js'; import { decorateSectionAnalytics } from '../../martech/attributes.js'; export const LOADING_ERROR = 'Could not load quiz results:'; @@ -19,7 +19,7 @@ async function loadFragments(el, experiences) { } function redirectPage(quizUrl, debug, message) { - const url = (quizUrl) ? quizUrl.text : 'https://adobe.com'; + const url = (quizUrl) ? getLocalizedURL(quizUrl.text) : 'https://adobe.com'; window.lana.log(message, { tags: 'errorType=error,module=quiz-results' }); if (debug === 'quiz-results') { diff --git a/libs/blocks/quiz/quiz.js b/libs/blocks/quiz/quiz.js index 3aabbde78e9..413963e545d 100644 --- a/libs/blocks/quiz/quiz.js +++ b/libs/blocks/quiz/quiz.js @@ -7,6 +7,7 @@ import { DecorateBlockBackground, DecorateBlockForeground } from './quizcontaine import { initConfigPathGlob, handleResultFlow, handleNext, transformToFlowData, getQuizData, getAnalyticsDataForBtn, getUrlParams, isValidUrl, + getLocalizedURL, } from './utils.js'; import StepIndicator from './stepIndicator.js'; @@ -265,7 +266,7 @@ const App = ({ }; const fragmentURL = getStringValue('footerFragment'); if (fragmentURL) { - loadFragments(fragmentURL); + loadFragments(getLocalizedURL(fragmentURL)); } const iconBg = getStringValue('icon-background-color'); if (iconBg) { diff --git a/libs/blocks/quiz/utils.js b/libs/blocks/quiz/utils.js index 4af0f535908..6be4d4d2cf3 100644 --- a/libs/blocks/quiz/utils.js +++ b/libs/blocks/quiz/utils.js @@ -18,7 +18,7 @@ const initConfigPath = (quizMetaData) => { const quizConfigPath = quizMetaData.data.text; const urlParams = new URLSearchParams(window.location.search); const stringsPath = urlParams.get('quiz-data'); - return (filepath) => `${stringsPath || quizConfigPath}${filepath}`; + return (filepath) => `${stringsPath || getLocalizedURL(quizConfigPath)}${filepath}`; }; async function fetchContentOfFile(path) { @@ -84,7 +84,8 @@ export const findAndStoreResultData = async (answers = []) => { let umbrellaProduct = ''; if (resultData.matchedResults.length > 0) { - destinationPage = resultData.matchedResults[0].url; + destinationPage = getLocalizedURL(resultData.matchedResults[0].url); + primaryProductCodes = resultData.primary; secondaryProductCodes = resultData.secondary; umbrellaProduct = resultData.matchedResults[0]['umbrella-result']; @@ -168,11 +169,11 @@ export const structuredFragments = ( resultResources?.data?.forEach((row) => { if (umbrellaProduct) { if (umbrellaProduct && row.product === umbrellaProduct) { - structureFragments.push(row[fragment]); + structureFragments.push(getLocalizedURL(row[fragment])); } } else if (primaryProducts?.length > 0 && primaryProducts.includes(row.product) && row[fragment]) { - structureFragments.push(row[fragment]); + structureFragments.push(getLocalizedURL(row[fragment])); } }); }); @@ -233,7 +234,7 @@ const getNestedFragments = (resultResources, productCodes, fragKey) => { function insertFragment() { row[fragKey]?.split(',').forEach((val) => { - fragArray.push(val.trim()); + fragArray.push(getLocalizedURL(val.trim())); }); } }); @@ -497,3 +498,17 @@ export const getAnalyticsDataForLocalStorage = (config) => { export const isValidUrl = (url) => VALID_URL_RE.test(url); export const getNormalizedMetadata = (el) => normalizeKeys(getMetadata(el)); + +export const getLocalizedURL = (originalURL) => { + const { locale } = getConfig(); + const prefix = locale?.prefix; + const localCode = locale?.ietf ?? 'en-US'; + + let localizedURL = originalURL; + + if (localCode !== 'en-US' && !originalURL.startsWith(`${prefix}/`)) { + localizedURL = `${prefix}${originalURL}`; + } + + return localizedURL; +}; diff --git a/test/blocks/quiz/utils.test.js b/test/blocks/quiz/utils.test.js index 8a9eeb52f47..e83b53089b1 100644 --- a/test/blocks/quiz/utils.test.js +++ b/test/blocks/quiz/utils.test.js @@ -12,8 +12,8 @@ const { findAndStoreResultData, } = await import('../../../libs/blocks/quiz/utils.js'); -const locales = { '': { ietf: 'en-US', tk: 'hah7vzn.css' } }; -const conf = { locales }; +let locales = { '': { ietf: 'en-US', tk: 'hah7vzn.css' } }; +let conf = { locales }; const QUIZ_BASE_PATH = 'https://mockdata/path/to/quiz'; setConfig(conf); @@ -245,6 +245,47 @@ describe('Quiz', () => { expect(flowData).to.be.an('array').of.length(5); }); + it('Testing getLocalizedURL with country code or without country code', async () => { + locales = { '': { ietf: 'de-DE', tk: 'hah7vzn.css' } }; + conf = { locales }; + conf.pathname = '/de'; + setConfig(conf); + + // Import getLocalizedURL function + const { getLocalizedURL } = await import('../../../libs/blocks/quiz/utils.js'); + + // Setup the URL and test the function + const fragmentURL = '/path/to/quiz/uar-results'; + const modifiedURL = getLocalizedURL(fragmentURL); + + // Assert the result + expect(modifiedURL).to.equal('/de/path/to/quiz/uar-results'); + + // Setup the URL and test the function + const fragmentURL2 = '/de/path/to/quiz/uar-results'; + const modifiedURL2 = getLocalizedURL(fragmentURL2); + + // Assert the result + expect(modifiedURL2).to.equal('/de/path/to/quiz/uar-results'); + }); + + it('Testing getLocalizedURL without locale define', async () => { + locales = { '': { } }; + conf = { locales }; + conf.pathname = '/de'; + setConfig(conf); + + // Import getLocalizedURL function + const { getLocalizedURL } = await import('../../../libs/blocks/quiz/utils.js'); + + // Setup the URL and test the function + const fragmentURL = '/path/to/quiz/uar-results'; + const modifiedURL = getLocalizedURL(fragmentURL); + + // Assert the result + expect(modifiedURL).to.equal('/path/to/quiz/uar-results'); + }); + describe('Testing storeResultInLocalStorage with empty results as input', async () => { let resultToDelegate; const primaryProductCodes = []; From 2ad6c839831c6e4dc26a679e428f8217cf71d6e5 Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Wed, 5 Jun 2024 12:38:46 -0700 Subject: [PATCH 3/8] update code according to feedbacks --- libs/blocks/quiz-results/quiz-results.js | 2 +- libs/blocks/quiz/utils.js | 12 ++------- test/blocks/quiz/utils.test.js | 33 +++++------------------- 3 files changed, 10 insertions(+), 37 deletions(-) diff --git a/libs/blocks/quiz-results/quiz-results.js b/libs/blocks/quiz-results/quiz-results.js index 2abcbe581b5..7465782fc79 100644 --- a/libs/blocks/quiz-results/quiz-results.js +++ b/libs/blocks/quiz-results/quiz-results.js @@ -19,7 +19,7 @@ async function loadFragments(el, experiences) { } function redirectPage(quizUrl, debug, message) { - const url = (quizUrl) ? getLocalizedURL(quizUrl.text) : 'https://adobe.com'; + const url = quizUrl ? getLocalizedURL(quizUrl.text) : 'https://adobe.com'; window.lana.log(message, { tags: 'errorType=error,module=quiz-results' }); if (debug === 'quiz-results') { diff --git a/libs/blocks/quiz/utils.js b/libs/blocks/quiz/utils.js index 6be4d4d2cf3..6bf625db5fb 100644 --- a/libs/blocks/quiz/utils.js +++ b/libs/blocks/quiz/utils.js @@ -501,14 +501,6 @@ export const getNormalizedMetadata = (el) => normalizeKeys(getMetadata(el)); export const getLocalizedURL = (originalURL) => { const { locale } = getConfig(); - const prefix = locale?.prefix; - const localCode = locale?.ietf ?? 'en-US'; - - let localizedURL = originalURL; - - if (localCode !== 'en-US' && !originalURL.startsWith(`${prefix}/`)) { - localizedURL = `${prefix}${originalURL}`; - } - - return localizedURL; + const { prefix, ietf = 'en-US' } = locale || {}; + return ietf !== 'en-US' && !originalURL.startsWith(`${prefix}/`) ? `${prefix}${originalURL}` : originalURL; }; diff --git a/test/blocks/quiz/utils.test.js b/test/blocks/quiz/utils.test.js index e83b53089b1..15bf95bad05 100644 --- a/test/blocks/quiz/utils.test.js +++ b/test/blocks/quiz/utils.test.js @@ -13,7 +13,7 @@ const { } = await import('../../../libs/blocks/quiz/utils.js'); let locales = { '': { ietf: 'en-US', tk: 'hah7vzn.css' } }; -let conf = { locales }; +const conf = { locales }; const QUIZ_BASE_PATH = 'https://mockdata/path/to/quiz'; setConfig(conf); @@ -247,43 +247,24 @@ describe('Quiz', () => { it('Testing getLocalizedURL with country code or without country code', async () => { locales = { '': { ietf: 'de-DE', tk: 'hah7vzn.css' } }; - conf = { locales }; - conf.pathname = '/de'; - setConfig(conf); + setConfig({ locales, pathname: '/de' }); // Import getLocalizedURL function const { getLocalizedURL } = await import('../../../libs/blocks/quiz/utils.js'); - // Setup the URL and test the function - const fragmentURL = '/path/to/quiz/uar-results'; - const modifiedURL = getLocalizedURL(fragmentURL); - - // Assert the result - expect(modifiedURL).to.equal('/de/path/to/quiz/uar-results'); - - // Setup the URL and test the function - const fragmentURL2 = '/de/path/to/quiz/uar-results'; - const modifiedURL2 = getLocalizedURL(fragmentURL2); - - // Assert the result - expect(modifiedURL2).to.equal('/de/path/to/quiz/uar-results'); + expect(getLocalizedURL('/path/to/quiz/uar-results')).to.equal('/de/path/to/quiz/uar-results'); + expect(getLocalizedURL('/de/path/to/quiz/uar-results')).to.equal('/de/path/to/quiz/uar-results'); }); it('Testing getLocalizedURL without locale define', async () => { locales = { '': { } }; - conf = { locales }; - conf.pathname = '/de'; - setConfig(conf); + setConfig({ locales, pathname: '/de' }); // Import getLocalizedURL function const { getLocalizedURL } = await import('../../../libs/blocks/quiz/utils.js'); - // Setup the URL and test the function - const fragmentURL = '/path/to/quiz/uar-results'; - const modifiedURL = getLocalizedURL(fragmentURL); - - // Assert the result - expect(modifiedURL).to.equal('/path/to/quiz/uar-results'); + expect(getLocalizedURL('/path/to/quiz/uar-results')).to.equal('/path/to/quiz/uar-results'); + expect(getLocalizedURL('/de/path/to/quiz/uar-results')).to.equal('/de/path/to/quiz/uar-results'); }); describe('Testing storeResultInLocalStorage with empty results as input', async () => { From ae5d280da41a9a2d16b8a02fa8a7945b0848d954 Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Mon, 17 Jun 2024 13:56:20 -0700 Subject: [PATCH 4/8] MWPW-150705: De-couple Result Spreadsheet for Interactive Front Door Experience --- libs/blocks/quiz-entry/quiz-entry.js | 8 ++++++- libs/blocks/quiz-entry/utils.js | 26 ++++++++++++++++------- libs/blocks/quiz/quiz.js | 4 +++- libs/blocks/quiz/utils.js | 31 +++++++++++++++++++++++----- test/blocks/quiz-entry/utils.test.js | 1 + test/blocks/quiz/quiz.test.js | 2 +- 6 files changed, 57 insertions(+), 15 deletions(-) diff --git a/libs/blocks/quiz-entry/quiz-entry.js b/libs/blocks/quiz-entry/quiz-entry.js index 96df7edfac9..6c9c9394ba1 100644 --- a/libs/blocks/quiz-entry/quiz-entry.js +++ b/libs/blocks/quiz-entry/quiz-entry.js @@ -16,10 +16,11 @@ const App = ({ analyticsType = null, questionData = { questions: { data: [] } }, stringsData = { questions: { data: [] } }, + resultsData = {}, debug = false, }) => { const [dataLoaded, setDataLoaded] = useState(false); - const [quizState, setQuizState] = useState({ userFlow: [], userSelection: [] }); + const [quizState, setQuizState] = useState({ userFlow: [], userSelection: [], results: {} }); const [quizLists, setQuizLists] = useState({}); const [quizData, setQuizData] = useState({}); const [hasMLData, setHasMLData] = useState(false); @@ -117,6 +118,7 @@ const App = ({ setQuizState({ userFlow: [questionDataArray[0].questions], userSelection: quizState.userSelection, + results: resultsData, }); setSelectedQuestion(qLists.questions[questionDataArray[0].questions]); } @@ -260,6 +262,7 @@ const App = ({ const currentQuizState = { userFlow: nextFlow, userSelection: nextSelections, + results: resultsData, }; localStorage.setItem('stored-quiz-state', JSON.stringify(currentQuizState)); setQuizState(currentQuizState); @@ -390,6 +393,7 @@ export default async function init( analyticsType: null, questionData: null, stringsData: null, + resultsData: null, debug: false, }, ) { @@ -408,6 +412,7 @@ export default async function init( analyticsType: '', questionData: { questions: { data: [] } }, stringsData: { questions: { data: [] } }, + resultsData: {}, debug: false, }; } @@ -424,6 +429,7 @@ export default async function init( analyticsType=${quizEntry.analyticsType || ''} questionData=${quizEntry.questionData} stringsData=${quizEntry.stringsData} + resultsData=${quizEntry.resultsData} debug=${quizEntry.debug || false} />`, el); } diff --git a/libs/blocks/quiz-entry/utils.js b/libs/blocks/quiz-entry/utils.js index 2000e60957d..f3e9c9d0b11 100644 --- a/libs/blocks/quiz-entry/utils.js +++ b/libs/blocks/quiz-entry/utils.js @@ -7,14 +7,25 @@ export async function fetchJson(path) { export async function getQuizJson(path) { try { - const [questions, strings] = await Promise.all( - [fetchJson(`${path}questions.json`), fetchJson(`${path}strings.json`)], - ); - return [questions, strings]; + // 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}`); + } + + return [questions, strings, results]; } catch (ex) { - window.lana?.log(`ERROR: Fetching data for quiz entry ${ex}`); + window.lana?.log(`ERROR: Fetching data for quiz entry: ${ex}`); + return []; } - return []; } export const handleNext = (questionsData, selectedQuestion, userInputSelections, userFlow) => { @@ -98,7 +109,7 @@ export async function getQuizEntryData(el) { const maxQuestions = Number(blockData.maxquestions?.text) || 10; const analyticsType = blockData.analyticstype?.text; const analyticsQuiz = blockData.analyticsquiz?.text; - const [questionData, stringsData] = await getQuizJson(dataPath); + const [questionData, stringsData, resultsData] = await getQuizJson(dataPath); return { quizPath, maxQuestions, @@ -106,5 +117,6 @@ export async function getQuizEntryData(el) { analyticsType, questionData, stringsData, + resultsData, }; } diff --git a/libs/blocks/quiz/quiz.js b/libs/blocks/quiz/quiz.js index 413963e545d..ea3293c63a3 100644 --- a/libs/blocks/quiz/quiz.js +++ b/libs/blocks/quiz/quiz.js @@ -42,6 +42,7 @@ const App = ({ const [userFlow, setUserFlow] = useState([]); const validQuestions = useMemo(() => [], []); const [debugBuild, setDebugBuild] = useState(null); + const [quizEntryData, setQuizEntryData] = useState({}); useEffect(() => { (async () => { @@ -62,6 +63,7 @@ const App = ({ && !!storedQuizState?.userSelection.length) { setUserFlow(storedQuizState.userFlow); updateUserSelection(storedQuizState.userSelection); + setQuizEntryData(storedQuizState.results); } else { setUserFlow([questions.questions.data[0].questions]); } @@ -149,7 +151,7 @@ const App = ({ console.log(`Error copying URL: ${err} URL: ${debugURL}`); }); } - handleResultFlow(transformToFlowData(userSelection)); + handleResultFlow(transformToFlowData(userSelection), quizEntryData); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [userSelection, nextQuizViewsExist]); diff --git a/libs/blocks/quiz/utils.js b/libs/blocks/quiz/utils.js index 6bf625db5fb..493979a9b91 100644 --- a/libs/blocks/quiz/utils.js +++ b/libs/blocks/quiz/utils.js @@ -63,9 +63,10 @@ export const defaultRedirect = (url) => { export const handleResultFlow = async ( answers = [], + quizEntryResults = {}, redirectFunc = defaultRedirect, ) => { - const { destinationPage } = await findAndStoreResultData(answers); + const { destinationPage } = await findAndStoreResultData(answers, quizEntryResults); const redirectUrl = getRedirectUrl(destinationPage); redirectFunc(redirectUrl); }; @@ -74,8 +75,8 @@ export const handleResultFlow = async ( * Handling the result flow from here. Will need to make sure we capture all * the data so that we can come back. */ -export const findAndStoreResultData = async (answers = []) => { - const entireResultData = await parseResultData(answers); +export const findAndStoreResultData = async (answers = [], quizEntryResults = {}) => { + const entireResultData = await parseResultData(answers, quizEntryResults); const resultData = entireResultData.filteredResults; const { resultResources } = entireResultData; let destinationPage = ''; @@ -265,8 +266,28 @@ export const getRedirectUrl = (destinationPage) => { return `${destinationPage}${separator}quizkey=${quizKey}`; }; -export const parseResultData = async (answers) => { - const results = await fetchContentOfFile(RESULTS_EP_NAME); +export const parseResultData = async (answers, quizEntryResults) => { + // Initialize an empty object for the results + const results = {}; + + // Fetch the content of the file asynchronously + const quizResultsData = await fetchContentOfFile(RESULTS_EP_NAME); + + // Destructure data from fetched content and the existing quizResultsData + const { result: { data: quizResultsDataArray } } = quizResultsData; + const { 'result-fragments': { data: quizFragmentsDataArray } } = quizResultsData; + const { 'result-destination': { data: quizDestinationDataArray } } = quizResultsData; + + // Check if quizEntryResults is defined and extract data, otherwise use empty arrays + const quizEntryResultsDataArray = quizEntryResults?.result?.data || []; + const quizEntryFragmentsDataArray = quizEntryResults?.['result-fragments']?.data || []; + const quizEntryDestinationDataArray = quizEntryResults?.['result-destination']?.data || []; + + // Merge the data arrays from both sources + results.result = { data: [...quizResultsDataArray, ...quizEntryResultsDataArray] }; + results['result-fragments'] = { data: [...quizFragmentsDataArray, ...quizEntryFragmentsDataArray] }; + results['result-destination'] = { data: [...quizDestinationDataArray, ...quizEntryDestinationDataArray] }; + const filteredResults = results.result.data.reduce( (resultObj, resultMap) => { let hasMatch = false; diff --git a/test/blocks/quiz-entry/utils.test.js b/test/blocks/quiz-entry/utils.test.js index 700f349907f..ad6f14c30c2 100644 --- a/test/blocks/quiz-entry/utils.test.js +++ b/test/blocks/quiz-entry/utils.test.js @@ -15,6 +15,7 @@ const quizConfig = { analyticsType: 'cc:app-reco', questionData: undefined, stringsData: undefined, + resultsData: undefined, }; const selectedQuestion = { questions: 'q-category', diff --git a/test/blocks/quiz/quiz.test.js b/test/blocks/quiz/quiz.test.js index b93afd18e78..53e9dd76fb9 100644 --- a/test/blocks/quiz/quiz.test.js +++ b/test/blocks/quiz/quiz.test.js @@ -232,7 +232,7 @@ describe('Quiz URL Parameter Tests', () => { it('should redirect to results page with quizkey parameter', async () => { const redirectStub = sinon.stub(); - await handleResultFlow(test, redirectStub); + await handleResultFlow(test, {}, redirectStub); const expectedUrl = '/path/to/result?quizkey=cc-quiz'; sinon.assert.calledWith(redirectStub, expectedUrl); }); From 3e2bf9cea0248a14769bb481ba79455100029867 Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Mon, 17 Jun 2024 21:33:03 -0700 Subject: [PATCH 5/8] add unit tests --- test/blocks/quiz-entry/mocks/mock-data.js | 941 ++++++++++++++++++++-- test/blocks/quiz-entry/mocks/results.json | 777 ++++++++++++++++++ test/blocks/quiz-entry/quiz-entry.test.js | 12 + test/blocks/quiz-entry/utils.test.js | 108 ++- 4 files changed, 1781 insertions(+), 57 deletions(-) create mode 100644 test/blocks/quiz-entry/mocks/results.json diff --git a/test/blocks/quiz-entry/mocks/mock-data.js b/test/blocks/quiz-entry/mocks/mock-data.js index e317479c83a..f369e9f0285 100644 --- a/test/blocks/quiz-entry/mocks/mock-data.js +++ b/test/blocks/quiz-entry/mocks/mock-data.js @@ -10,35 +10,40 @@ const resultsMock = { 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', + 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', + 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', + 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', + 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', + image: + 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-video/5-AU-SoundEffects.png', }, ], }, @@ -52,35 +57,40 @@ const resultsMock = { 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', + 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', + 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', + 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', + 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', + image: + 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q3/4-Designer@1x.png', }, ], }, @@ -101,42 +111,48 @@ const resultsMock = { 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', + 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', + 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', + 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', + 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', + 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', + image: + 'https://main--milo--adobecom.hlx.page/drafts/colloyd/quiz-entry/images/3dar.png', }, ], }, @@ -148,10 +164,12 @@ const resultsMock = { { 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.', + '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', + background: + 'https://milo.adobe.com/drafts/quiz/quiz-2/quiz-background.jpeg', footerFragment: '', }, { @@ -160,7 +178,8 @@ const resultsMock = { 'sub-head': 'Please choose up to three options.', btn: 'Next', text: '', - background: 'https://milo.adobe.com/drafts/quiz/quiz-2/quiz-background.jpeg', + background: + 'https://milo.adobe.com/drafts/quiz/quiz-2/quiz-background.jpeg', footerFragment: '', }, { @@ -169,8 +188,10 @@ const resultsMock = { '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', + 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', @@ -178,7 +199,8 @@ const resultsMock = { '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', + background: + 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Photo%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', footerFragment: '', }, { @@ -187,7 +209,8 @@ const resultsMock = { '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', + background: + 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Design%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', footerFragment: '', }, { @@ -196,7 +219,8 @@ const resultsMock = { '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', + background: + 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Illustration%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', footerFragment: '', }, { @@ -205,7 +229,8 @@ const resultsMock = { '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', + background: + 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q2-Acrobat%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', footerFragment: '', }, { @@ -214,7 +239,8 @@ const resultsMock = { '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', + background: + 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-3D-AR%20BKGD?$pjpeg$&jpegSize=300&wid=1920', footerFragment: '', }, { @@ -223,7 +249,8 @@ const resultsMock = { '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', + background: + 'https://cc-prod.scene7.com/is/image/CCProdAuthor/DSK-Q3-Learn%20BKGD%202X?$pjpeg$&jpegSize=300&wid=1920', footerFragment: '', }, { @@ -232,8 +259,10 @@ const resultsMock = { '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', + 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', }, ], }, @@ -247,14 +276,16 @@ const resultsMock = { 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', + 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', + image: + 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/2-CustomDesigns.png', }, ], }, @@ -268,35 +299,40 @@ const resultsMock = { 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', + 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', + 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', + 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', + 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', + image: + 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-photo/5-PS-BlendImages.png', }, ], }, @@ -359,42 +395,48 @@ const resultsMock = { 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', + 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', + 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', + 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', + 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', + 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', + image: + 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-pdf/6-Ac-TrackSignatures.png', }, ], }, @@ -408,21 +450,24 @@ const resultsMock = { 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', + 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', + 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', + image: + 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-design/3-Ai-CreateGraphics.png', }, ], }, @@ -436,28 +481,32 @@ const resultsMock = { 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', + 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', + 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', + 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', + image: + 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q2-illustration/4-PS-BlendImages.png', }, ], }, @@ -471,21 +520,24 @@ const resultsMock = { 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', + 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', + 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', + image: + 'https://www.adobe.com/content/dam/cc/Images/app-recommender/multi-select/quiz-question-card-thumbnails/q4/1-Individual.png', }, ], }, @@ -1034,6 +1086,791 @@ const resultsMock = { ], ':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/results.json b/test/blocks/quiz-entry/mocks/results.json new file mode 100644 index 00000000000..6028b524c70 --- /dev/null +++ b/test/blocks/quiz-entry/mocks/results.json @@ -0,0 +1,777 @@ +{ + "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/quiz-entry.test.js b/test/blocks/quiz-entry/quiz-entry.test.js index d1de93beb24..8a3ac889e93 100644 --- a/test/blocks/quiz-entry/quiz-entry.test.js +++ b/test/blocks/quiz-entry/quiz-entry.test.js @@ -189,6 +189,18 @@ describe('Quiz Entry Component', () => { 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', () => { diff --git a/test/blocks/quiz-entry/utils.test.js b/test/blocks/quiz-entry/utils.test.js index ad6f14c30c2..6f9ff8ccdab 100644 --- a/test/blocks/quiz-entry/utils.test.js +++ b/test/blocks/quiz-entry/utils.test.js @@ -5,9 +5,11 @@ 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, @@ -51,9 +53,24 @@ describe('Quiz Entry Utils', () => { beforeEach(async () => { window.lana = { log: sinon.stub() }; fetchStub = sinon.stub(window, 'fetch'); - fetchStub.resolves({ + fetchStub.withArgs(`${path}questions.json`).resolves({ ok: true, - json: () => Promise.resolve(mockData), + 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')), }); }); @@ -92,9 +109,90 @@ describe('Quiz Entry Utils', () => { }); it('should fetch quiz data', async () => { - const [questions, strings] = await getQuizJson('./mocks/'); - expect(questions.questions).to.deep.equal(mockQuestionsData); - expect(strings.strings).to.deep.equal(mockStringsData); + 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" + ); }); }); From 5652302174d83743c21e0a8468e3f6d3b876582a Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Mon, 17 Jun 2024 21:40:04 -0700 Subject: [PATCH 6/8] fix lint errors --- test/blocks/quiz-entry/utils.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/blocks/quiz-entry/utils.test.js b/test/blocks/quiz-entry/utils.test.js index 6f9ff8ccdab..a81e6d5c3b8 100644 --- a/test/blocks/quiz-entry/utils.test.js +++ b/test/blocks/quiz-entry/utils.test.js @@ -165,7 +165,7 @@ describe('Quiz Entry Utils', () => { // 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' + 'ERROR: Fetching data for quiz entry: Error: Internal server error', ); }); @@ -191,7 +191,7 @@ describe('Quiz Entry Utils', () => { // 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" + "INFO: results.json not found or couldn't be fetched: Error: File not found", ); }); }); From 051d1e43f2b104a5d9ac528ab4f627826051ad3c Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Tue, 18 Jun 2024 09:24:30 -0700 Subject: [PATCH 7/8] update lana with tags --- libs/blocks/quiz-entry/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/blocks/quiz-entry/utils.js b/libs/blocks/quiz-entry/utils.js index f3e9c9d0b11..dfca985432c 100644 --- a/libs/blocks/quiz-entry/utils.js +++ b/libs/blocks/quiz-entry/utils.js @@ -18,12 +18,12 @@ export async function getQuizJson(path) { try { results = await fetchJson(`${path}results.json`); } catch (ex) { - window.lana?.log(`INFO: results.json not found or couldn't be fetched: ${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}`); + window.lana?.log(`ERROR: Fetching data for quiz entry: ${ex}`, { tags: 'errorType=error,module=quiz-entry' }); return []; } } From 4194fb1a9fd023a76c4362da5cb4bab6c5851e86 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 24 Jun 2024 00:38:17 +0000 Subject: [PATCH 8/8] Update self hosted dependency --- libs/deps/imslib.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/deps/imslib.min.js b/libs/deps/imslib.min.js index a4e6e7ea666..53e1c81602d 100644 --- a/libs/deps/imslib.min.js +++ b/libs/deps/imslib.min.js @@ -1,4 +1,4 @@ -// Built 2024-05-22T01:11:29.633Z - Last Modified 2024-05-21T12:11:43.000Z +// Built 2024-06-24T00:38:17.656Z - Last Modified 2024-05-21T12:11:43.000Z var roll=function(){ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved.