From 5e19b818decf16882b228cc56ebfe9989d40e0f7 Mon Sep 17 00:00:00 2001 From: Hayley Parra Date: Mon, 24 Jul 2023 08:59:04 -0700 Subject: [PATCH] Autofix subset of eslint errors (#987) --- build/htm-preact-debug.js | 8 +++- build/htm-preact.js | 8 +++- libs/blocks/accordion/accordion.js | 22 +++++----- libs/blocks/aside/aside.js | 2 +- .../blocks/bulk-publish/bulk-publish-utils.js | 8 ++-- libs/blocks/bulk-publish/bulk-publish.js | 4 +- libs/blocks/caas-config/caas-config.js | 33 +++++++-------- libs/blocks/caas-config/caas-tags.js | 2 +- libs/blocks/card/card.js | 4 +- libs/blocks/chart/chart.js | 4 +- libs/blocks/commerce/commerce.js | 5 +-- .../features/search/gnav-search.js | 2 +- libs/blocks/icon-block/icon-block.js | 4 +- libs/blocks/marketo/marketo.js | 9 ++-- libs/blocks/marquee/marquee.js | 2 +- .../recommended-articles.js | 2 +- .../components/helixReview/HelixReview.js | 8 ++-- .../review/components/review/Comments.js | 2 +- .../review/components/review/Ratings.js | 6 +-- .../blocks/review/components/review/Review.js | 24 +++++------ libs/blocks/review/utils/sanitizeComment.js | 6 +-- libs/blocks/review/utils/utils.js | 12 +++--- .../section-metadata/section-metadata.js | 2 +- libs/blocks/share/share.js | 24 +++++------ libs/blocks/tabs/tabs.js | 4 +- libs/blocks/tag-selector/tag-selector.js | 25 ++++++----- libs/blocks/text/text.js | 4 +- libs/features/georoutingv2/georoutingv2.js | 2 +- libs/hooks/useHover.js | 2 +- libs/ui/controls/MultiField.js | 7 ++-- libs/ui/controls/TagSelectPicker.js | 4 +- libs/utils/action.js | 12 +++--- libs/utils/decorate.js | 12 +++--- libs/utils/lana.js | 28 ++++++------- libs/utils/tree.js | 8 ++-- .../accordion/editorial-accordion.test.js | 2 +- .../expectedConfigs/defaultConfig.js | 6 +-- test/blocks/card/card.test.js | 2 +- test/blocks/carousel/carousel.test.js | 14 +++---- test/blocks/commerce/commerce.test.js | 8 +--- test/blocks/faas/utils.test.js | 2 +- test/blocks/footer/footer.test.js | 2 +- .../gnav/gnav-contextual-search.test.js | 2 +- test/blocks/gnav/gnav-search.test.js | 18 +++----- test/blocks/gnav/gnav.test.js | 21 +++++----- test/blocks/iframe/iframe.test.js | 4 +- test/blocks/marketo/mocks/marketo-utils.js | 40 +++++++++--------- test/blocks/marquee/marquee.test.js | 2 +- test/blocks/read-more/read-more.test.js | 2 +- test/blocks/share/share.test.js | 2 +- test/blocks/text/text.test.js | 6 +-- .../georoutingv2/georoutingv2.test.js | 2 +- test/utils/action.test.js | 41 +++++++++---------- test/utils/lanaDefaultOptions.test.js | 2 +- test/utils/richresults.test.js | 6 +-- tools/caas-import/parseCaasConfig.js | 2 +- tools/send-to-caas/send-to-caas.js | 4 +- tools/utils/utils.js | 4 +- 58 files changed, 246 insertions(+), 259 deletions(-) diff --git a/build/htm-preact-debug.js b/build/htm-preact-debug.js index dddb229f208..73a78b812a6 100644 --- a/build/htm-preact-debug.js +++ b/build/htm-preact-debug.js @@ -1,9 +1,13 @@ import 'preact/debug'; import { h, Component, createContext, createRef, render } from 'preact'; import { signal } from '@preact/signals'; -import { useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary, useId } from 'preact/hooks'; +import { + useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary, useId, +} from 'preact/hooks'; import htm from 'htm'; const html = htm.bind(h); -export { h, html, signal, render, Component, createContext, createRef, useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary, useId }; +export { + h, html, signal, render, Component, createContext, createRef, useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary, useId, +}; diff --git a/build/htm-preact.js b/build/htm-preact.js index ced722cb284..92578ead5da 100644 --- a/build/htm-preact.js +++ b/build/htm-preact.js @@ -2,9 +2,13 @@ import { h, Component, createContext, createRef, render } from 'preact'; import { signal } from '@preact/signals'; -import { useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary, useId } from 'preact/hooks'; +import { + useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary, useId, +} from 'preact/hooks'; import htm from 'htm'; const html = htm.bind(h); -export { h, html, signal, render, Component, createContext, createRef, useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary, useId }; +export { + h, html, signal, render, Component, createContext, createRef, useState, useReducer, useEffect, useLayoutEffect, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, useErrorBoundary, useId, +}; diff --git a/libs/blocks/accordion/accordion.js b/libs/blocks/accordion/accordion.js index 06db6242336..ff8ccfa2dbc 100644 --- a/libs/blocks/accordion/accordion.js +++ b/libs/blocks/accordion/accordion.js @@ -15,7 +15,7 @@ function setSEO(questions) { function toggleMedia(con, trig, status) { if (status === 'open') { trig.setAttribute('hidden', ''); - trig.setAttribute('aria-expanded', 'false'); + trig.setAttribute('aria-expanded', 'false'); con.setAttribute('hidden', ''); con.setAttribute('aria-expanded', 'false'); } else { @@ -43,8 +43,8 @@ function displayMedia(displayArea, el, dd, i, expanded) { if (expanded) { toggleMedia(dd, el, 'open'); displayArea.childNodes[i - 1]?.classList.remove('expanded'); - } - } + } + }, ); } @@ -94,7 +94,7 @@ function createItem(accordion, id, heading, num, edit) { if (edit) { const ogMedia = mediaCollection[id][num - 1]; const mediaCopy = ogMedia.cloneNode(true); - dm.append(mediaCopy) + dm.append(mediaCopy); dd.prepend(dm); } @@ -117,7 +117,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 accordionMedia = createTag('div', { class: 'accordion-media', id: `accordion-media-${id}`}); + const accordionMedia = createTag('div', { class: 'accordion-media', id: `accordion-media-${id}` }); const isSeo = el.classList.contains('seo'); const isEditorial = el.classList.contains('editorial'); decorateButtons(el); @@ -125,15 +125,13 @@ export default function init(el) { if (isEditorial) { const editorialMedia = el.querySelectorAll(':scope > div:nth-child(3n)'); [...editorialMedia].map( - (media, idx, collection) => - populateMedia(accordionMedia, id, idx, collection) + (media, idx, collection) => populateMedia(accordionMedia, id, idx, collection), ); - }; + } const headings = el.querySelectorAll(':scope > div:nth-child(odd)'); const items = [...headings].map( - (heading, idx) => - createItem(accordion, id, heading, idx + 1, isEditorial, accordionMedia) + (heading, idx) => createItem(accordion, id, heading, idx + 1, isEditorial, accordionMedia), ); if (isSeo) { setSEO(items); } @@ -145,9 +143,9 @@ export default function init(el) { accordion.classList.add('foreground'); decorateBlockAnalytics(el); decorateLinkAnalytics(accordion, headings); - el.append(accordion) + el.append(accordion); if (isEditorial) { el.append(accordionMedia); defalutOpen(el); - }; + } } diff --git a/libs/blocks/aside/aside.js b/libs/blocks/aside/aside.js index b985c53b64f..a5c7cf8dedb 100644 --- a/libs/blocks/aside/aside.js +++ b/libs/blocks/aside/aside.js @@ -43,7 +43,7 @@ function getBlockData(el) { function decorateStaticLinks(el) { if (!el.classList.contains('notification')) return; const textLinks = el.querySelectorAll('a:not([class])'); - textLinks.forEach((link) => { link.classList.add('static') }); + textLinks.forEach((link) => { link.classList.add('static'); }); } function decorateLayout(el) { diff --git a/libs/blocks/bulk-publish/bulk-publish-utils.js b/libs/blocks/bulk-publish/bulk-publish-utils.js index 6046afac23a..fd39604e963 100644 --- a/libs/blocks/bulk-publish/bulk-publish-utils.js +++ b/libs/blocks/bulk-publish/bulk-publish-utils.js @@ -103,11 +103,9 @@ const siteIsSupported = async (url) => { } }; -export const getUrls = (element) => { - return element.current?.value.split('\n') - .filter((url) => url.length > 0) - .map((e) => e.trim()); -}; +export const getUrls = (element) => element.current?.value.split('\n') + .filter((url) => url.length > 0) + .map((e) => e.trim()); export const getActionName = (action, useGerund) => { let name; diff --git a/libs/blocks/bulk-publish/bulk-publish.js b/libs/blocks/bulk-publish/bulk-publish.js index 0f7d421a560..6a2fd25ab38 100644 --- a/libs/blocks/bulk-publish/bulk-publish.js +++ b/libs/blocks/bulk-publish/bulk-publish.js @@ -160,7 +160,9 @@ function StatusCompletion({ completion }) { } // eslint-disable-next-line max-len -function Status({ valid, urlNumber, bulkTriggered, submittedAction, result, resultsElt, completion }) { +function Status({ + valid, urlNumber, bulkTriggered, submittedAction, result, resultsElt, completion, +}) { return valid && html`
diff --git a/libs/blocks/caas-config/caas-config.js b/libs/blocks/caas-config/caas-config.js index 06c39a152f1..971dbd93275 100644 --- a/libs/blocks/caas-config/caas-config.js +++ b/libs/blocks/caas-config/caas-config.js @@ -42,7 +42,7 @@ const getHashConfig = () => { const encodedConfig = hash.startsWith('#') ? hash.substring(1) : hash; return parseEncodedConfig(encodedConfig); -} +}; const caasFilesLoaded = loadCaasFiles(); @@ -64,7 +64,7 @@ const defaultOptions = { 'double-wide': 'Double Width Card', product: 'Product Card', 'text-card': 'Text Card', - 'custom-card': 'Custom Card' + 'custom-card': 'Custom Card', }, collectionBtnStyle: { primary: 'Primary', @@ -80,8 +80,8 @@ const defaultOptions = { carousel: 'Carousel', }, ctaActions: { - '_blank': 'New Tab', - '_self': 'Same Tab', + _blank: 'New Tab', + _self: 'Same Tab', }, draftDb: { false: 'Live', @@ -193,11 +193,10 @@ const defaultOptions = { }, }; -const getTagList = (root) => - Object.entries(root).reduce((options, [, tag]) => { - options[tag.tagID] = tag.title; - return options; - }, {}); +const getTagList = (root) => Object.entries(root).reduce((options, [, tag]) => { + options[tag.tagID] = tag.title; + return options; +}, {}); const getTagTree = (root) => { const options = Object.entries(root).reduce((opts, [, tag]) => { @@ -238,7 +237,7 @@ const Select = ({ label, options, prop, sort = false }) => { `; }; -const Input = ({ label, type = 'text', prop, defaultValue = '', title}) => { +const Input = ({ label, type = 'text', prop, defaultValue = '', title }) => { const context = useContext(ConfiguratorContext); const onInputChange = (val, e) => { @@ -514,7 +513,7 @@ const FilterPanel = ({ tagsData }) => { <${Select} label="Event Filter" prop="filterEvent" options=${defaultOptions.filterEvent} /> <${Select} label="Automatic or Custom Panel" prop="filterBuildPanel" options=${defaultOptions.filterBuildPanel} /> `; - + const FilterBuildPanel = html` <${FilterOptions}> <${MultiField} @@ -608,15 +607,13 @@ const PaginationPanel = () => { `; }; -const TargetPanel = () => - html` +const TargetPanel = () => html` <${Input} label="Target Enabled" prop="targetEnabled" type="checkbox" /> <${Input} label="Last Viewed Session" prop="lastViewedSession" type="checkbox" /> <${Input} label="Target Activity" prop="targetActivity" type="text" /> `; -const AnalyticsPanel = () => - html`<${Input} label="Track Impression" prop="analyticsTrackImpression" type="checkbox" /> +const AnalyticsPanel = () => html`<${Input} label="Track Impression" prop="analyticsTrackImpression" type="checkbox" /> <${Input} label="Collection Name" prop="analyticsCollectionName" type="text" />`; const AdvancedPanel = () => { @@ -687,7 +684,7 @@ const getInitialState = () => { // /* c8 ignore next 2 */ if (!state) { const lsState = localStorage.getItem(LS_KEY); - // For backwards compatibilty: Check that localStorage state exists + // For backwards compatibilty: Check that localStorage state exists // and it contains the new filtersCustom attribute before using it if (lsState?.includes('filtersCustom')) { try { @@ -776,8 +773,8 @@ const CopyBtn = () => { return html`
`; -} +}; const TagSelector = () => { const [options, setOptions] = useState(); @@ -36,14 +36,14 @@ const TagSelector = () => { const getTagTree = (root) => { const options = Object.entries(root).reduce((opts, [, tag]) => { opts[tag.tagID] = {}; - + if (Object.keys(tag.tags).length) { opts[tag.tagID].children = getTagTree(tag.tags); } - + opts[tag.tagID].label = tag.title; opts[tag.tagID].path = tag.path.replace('/content/cq:tags/caas/', ''); - + return opts; }, {}); return options; @@ -85,9 +85,8 @@ const TagSelector = () => { setSelectedTags((tags) => { if (tags.includes(value)) { return tags.filter((tag) => tag !== value); - } else { - return [...tags, value]; } + return [...tags, value]; }); }; @@ -99,18 +98,18 @@ const TagSelector = () => {
- ${options && - optionMap && - html`<${Picker} + ${options + && optionMap + && html`<${Picker} toggleTag=${toggleTag} options=${options} optionMap=${optionMap} selectedTags=${selectedTags} />` - } +} <${TagPreview} selectedTags=${selectedTags} /> `; -} +}; export default async function init(el) { render(html`<${TagSelector} />`, el); diff --git a/libs/blocks/text/text.js b/libs/blocks/text/text.js index 6c962686001..e3452ce4dc5 100644 --- a/libs/blocks/text/text.js +++ b/libs/blocks/text/text.js @@ -54,9 +54,9 @@ export default function init(el) { if (el.classList.contains('link-farm')) { const foregroundDiv = el.querySelectorAll('.foreground')[1]; const count = foregroundDiv.querySelectorAll('h3').length; - foregroundDiv.querySelectorAll('div').forEach(divElem => { + foregroundDiv.querySelectorAll('div').forEach((divElem) => { if (!divElem.querySelector('h3') && count) { - const headingElem = createTag('h3', { class: 'no-heading'}); + const headingElem = createTag('h3', { class: 'no-heading' }); divElem.insertBefore(headingElem, divElem.firstChild); } }); diff --git a/libs/features/georoutingv2/georoutingv2.js b/libs/features/georoutingv2/georoutingv2.js index cd734490e58..4883453c6e1 100644 --- a/libs/features/georoutingv2/georoutingv2.js +++ b/libs/features/georoutingv2/georoutingv2.js @@ -171,7 +171,7 @@ function openPicker(button, locales, country, event, dir) { if (spaceBelowButton <= list.offsetHeight) { list.classList.add('top'); } - + button.setAttribute('aria-expanded', true); removeOnClickOutsideElement(list, event, button); } diff --git a/libs/hooks/useHover.js b/libs/hooks/useHover.js index 18d4d16385b..0dcc09ced5e 100644 --- a/libs/hooks/useHover.js +++ b/libs/hooks/useHover.js @@ -35,7 +35,7 @@ const useHover = ({ refToAttachTo = null, useMouseLeave = false } = {}) => { } return undefined; }, - [ref.current] // Recall only if ref changes + [ref.current], // Recall only if ref changes ); return [ref, hoverState]; diff --git a/libs/ui/controls/MultiField.js b/libs/ui/controls/MultiField.js index e72d98684d1..43de16c267e 100644 --- a/libs/ui/controls/MultiField.js +++ b/libs/ui/controls/MultiField.js @@ -25,7 +25,7 @@ const populateFieldValues = (fields, value) => fields.map((field) => { }); // MultiField assumes that Fields have `name || id`, `onChange`, and `value` props. -const MultiField = ({ +const MultiField = ({ children, className = '', values, @@ -36,10 +36,11 @@ const MultiField = ({ parentIndex, name, addBtnLabel = 'Add', - addBtnTitle }) => { + addBtnTitle, +}) => { const [fieldValues, setFieldValues] = useState( (values && [...values]) - || [...(parentValues[parentIndex][name] ?? [])] + || [...(parentValues[parentIndex][name] ?? [])], ); const [fieldSets, setFieldSets] = useState([]); const [keys] = useState(getFieldNameOrId(Array.isArray(children) ? children : [children])); diff --git a/libs/ui/controls/TagSelectPicker.js b/libs/ui/controls/TagSelectPicker.js index ba128bf7a1f..6cd9611a0fb 100644 --- a/libs/ui/controls/TagSelectPicker.js +++ b/libs/ui/controls/TagSelectPicker.js @@ -9,8 +9,7 @@ const Tag = ({ isExpanded, onCheck, onExpand, -}) => { - return html` +}) => html`
` : ''}
`; -}; const Picker = ({ close, diff --git a/libs/utils/action.js b/libs/utils/action.js index ecda1bfc332..0f8743e9d01 100644 --- a/libs/utils/action.js +++ b/libs/utils/action.js @@ -1,10 +1,10 @@ export function debounce(callback, time = 300) { - if (typeof callback !== 'function') return undefined; + if (typeof callback !== 'function') return undefined; - let timer = null; + let timer = null; - return (...args) => { - clearTimeout(timer); - timer = setTimeout(() => callback(...args), time); - }; + return (...args) => { + clearTimeout(timer); + timer = setTimeout(() => callback(...args), time); + }; } diff --git a/libs/utils/decorate.js b/libs/utils/decorate.js index 4bbfaded011..7195bfee9cc 100644 --- a/libs/utils/decorate.js +++ b/libs/utils/decorate.js @@ -3,7 +3,7 @@ import { decorateLinkAnalytics } from '../martech/attributes.js'; export function decorateButtons(el, size) { const buttons = el.querySelectorAll('em a, strong a, p > a strong'); if (buttons.length === 0) return; - const buttonTypeMap = {'STRONG': 'blue', 'EM': 'outline', 'A': 'blue'}; + const buttonTypeMap = { STRONG: 'blue', EM: 'outline', A: 'blue' }; buttons.forEach((button) => { const parent = button.parentElement; const buttonType = buttonTypeMap[parent.nodeName] || 'outline'; @@ -78,20 +78,20 @@ export function getBlockSize(el, defaultSize = 1) { } function applyTextOverrides(el, override) { - const parts = override.split("-"); + const parts = override.split('-'); const type = parts[1]; const els = el.querySelectorAll(`[class^="${type}"]`); if (!els.length) return; - els.forEach(elem => { - const replace = [...elem.classList].find(i => i.startsWith(type)); + els.forEach((elem) => { + const replace = [...elem.classList].find((i) => i.startsWith(type)); elem.classList.replace(replace, `${parts[1]}-${parts[0]}`); }); } export function decorateTextOverrides(el, options = ['-heading', '-body', '-detail']) { - const overrides = [...el.classList].filter(elClass => options.findIndex(ovClass => elClass.endsWith(ovClass)) >= 0); + const overrides = [...el.classList].filter((elClass) => options.findIndex((ovClass) => elClass.endsWith(ovClass)) >= 0); if (!overrides.length) return; - overrides.forEach(override => { + overrides.forEach((override) => { applyTextOverrides(el, override); el.classList.remove(override); }); diff --git a/libs/utils/lana.js b/libs/utils/lana.js index a0bb4aedab4..64650f9b75c 100644 --- a/libs/utils/lana.js +++ b/libs/utils/lana.js @@ -15,7 +15,7 @@ const w = window; function isProd() { - const host = window.location.host; + const { host } = window.location; if (host.substring(host.length - 10) === '.adobe.com' && host.substring(host.length - 15) !== '.corp.adobe.com' && host.substring(host.length - 16) !== '.stage.adobe.com') { @@ -35,7 +35,7 @@ function getOpt(key) { if (op1[key] !== undefined) { - return op1[key] + return op1[key]; } if (op2[key] !== undefined) { return op2[key]; @@ -43,22 +43,20 @@ return defaultOptions[key]; } - return Object.keys(defaultOptions).reduce(function (options, key) { + return Object.keys(defaultOptions).reduce((options, key) => { options[key] = getOpt(key); return options; }, {}); } function sendUnhandledError(e) { - log(e.reason || e.error || e.message, { - errorType: 'i', - }); + log(e.reason || e.error || e.message, { errorType: 'i' }); } function log(msg, options) { msg = msg && msg.stack ? msg.stack : (msg || ''); if (msg.length > MSG_LIMIT) { - msg = msg.slice(0, MSG_LIMIT) + ''; + msg = `${msg.slice(0, MSG_LIMIT)}`; } const o = mergeOptions(options, w.lana.options); @@ -75,14 +73,14 @@ const endpoint = (!isProdDomain || !o.useProd) ? o.endpointStage : o.endpoint; const queryParams = [ - 'm=' + encodeURIComponent(msg), - 'c=' + encodeURI(o.clientId), - 's=' + sampleRate, - 't=' + encodeURI(o.errorType), + `m=${encodeURIComponent(msg)}`, + `c=${encodeURI(o.clientId)}`, + `s=${sampleRate}`, + `t=${encodeURI(o.errorType)}`, ]; if (o.tags) { - queryParams.push('tags=' + encodeURI(o.tags)); + queryParams.push(`tags=${encodeURI(o.tags)}`); } if (!isProdDomain || w.lana.debug || w.lana.localhost) console.log('LANA Msg: ', msg, '\nOpts:', o); @@ -91,11 +89,11 @@ const xhr = new XMLHttpRequest(); if (w.lana.debug) { queryParams.push('d'); - xhr.addEventListener('load', function () { + xhr.addEventListener('load', () => { console.log('LANA response:', xhr.responseText); }); } - xhr.open('GET', endpoint + '?' + queryParams.join('&')); + xhr.open('GET', `${endpoint}?${queryParams.join('&')}`); xhr.send(); return xhr; } @@ -111,7 +109,7 @@ w.lana = { debug: false, - log: log, + log, options: mergeOptions(w.lana && w.lana.options), }; diff --git a/libs/utils/tree.js b/libs/utils/tree.js index 49799d78444..fd03867d24d 100644 --- a/libs/utils/tree.js +++ b/libs/utils/tree.js @@ -20,14 +20,14 @@ export default class Tree { * traverse(node = this.root) { yield node; if (node.children.length) { - for (let child of node.children) { + for (const child of node.children) { yield* this.traverse(child); } } } insert(parentNodeKey, key, value = key) { - for (let node of this.traverse()) { + for (const node of this.traverse()) { if (node.key === parentNodeKey) { node.children.push(new Node(key, value, node)); return true; @@ -37,7 +37,7 @@ export default class Tree { } remove(key) { - for (let node of this.traverse()) { + for (const node of this.traverse()) { const filtered = node.children.filter((c) => c.key !== key); if (filtered.length !== node.children.length) { node.children = filtered; @@ -48,7 +48,7 @@ export default class Tree { } find(key) { - for (let node of this.traverse()) { + for (const node of this.traverse()) { if (node.key === key) return node; } return undefined; diff --git a/test/blocks/accordion/editorial-accordion.test.js b/test/blocks/accordion/editorial-accordion.test.js index 283cb3be4d2..8dd8b1a06a4 100644 --- a/test/blocks/accordion/editorial-accordion.test.js +++ b/test/blocks/accordion/editorial-accordion.test.js @@ -12,7 +12,7 @@ describe('Accordion', () => { const accordions = document.body.querySelectorAll('.accordion'); accordions.forEach((accordion) => { module.default(accordion); - }) + }); }); it('Load editorial body', async () => { diff --git a/test/blocks/caas-config/expectedConfigs/defaultConfig.js b/test/blocks/caas-config/expectedConfigs/defaultConfig.js index 989095358ca..6a23087d161 100644 --- a/test/blocks/caas-config/expectedConfigs/defaultConfig.js +++ b/test/blocks/caas-config/expectedConfigs/defaultConfig.js @@ -34,7 +34,7 @@ const defaultConfig = { disableBanners: false, reservoir: { sample: 3, pool: 1000 }, ctaAction: '_blank', - additionalRequestParams: {} + additionalRequestParams: {}, }, hideCtaIds: [ '', @@ -130,9 +130,9 @@ const defaultConfig = { analytics: { trackImpressions: '', collectionIdentifier: '' }, target: { enabled: '', - lastViewedSession: '' + lastViewedSession: '', }, - customCard: ["card","return ``"] + customCard: ['card', 'return ``'], }; export default defaultConfig; diff --git a/test/blocks/card/card.test.js b/test/blocks/card/card.test.js index 0a2b18a8015..6b34e39edd3 100644 --- a/test/blocks/card/card.test.js +++ b/test/blocks/card/card.test.js @@ -75,7 +75,7 @@ describe('Card', () => { expect(el.outerHTML.includes('undefined')).to.be.false; }); }); - + describe('Two-Up Cards', () => { before(async () => { document.body.innerHTML = await readFile({ path: './mocks/two-up-cards.html' }); diff --git a/test/blocks/carousel/carousel.test.js b/test/blocks/carousel/carousel.test.js index 7c11e6df9f6..f154b3398f5 100644 --- a/test/blocks/carousel/carousel.test.js +++ b/test/blocks/carousel/carousel.test.js @@ -55,7 +55,7 @@ describe('Carousel', () => { const previousButton = document.body.querySelector('.carousel-next'); const slides = document.body.querySelectorAll('.carousel-slide'); const slideIndicators = document.body.querySelectorAll('.carousel-indicator'); - + nextButton.focus(); await sendKeys({ press: 'ArrowRight' }); let activeSlide = slides[1].classList.contains('active'); @@ -108,7 +108,7 @@ describe('Carousel', () => { expect(lightboxActive).to.be.true; expect(curtain).to.exist; - //Close lightbox by clicking on curtain + // Close lightbox by clicking on curtain curtain.click(); lightboxActive = el.classList.contains('lightbox-active'); curtain = el.querySelector('.carousel-curtain'); @@ -137,11 +137,11 @@ describe('Carousel', () => { it('Mobile swipe distance and direction capture', () => { const swipeDistance = {}; - const swipe = {xMin: 50, xStart: 2402, xEnd: 2284}; - const swipeRight = {xMin: 50, xStart: 2284, xEnd: 2402}; + const swipe = { xMin: 50, xStart: 2402, xEnd: 2284 }; + const swipeRight = { xMin: 50, xStart: 2284, xEnd: 2402 }; swipeDistance.xDistance = getSwipeDistance(swipe.xStart, swipe.xEnd); - const swipeDirection = getSwipeDirection(swipe, swipeDistance); - const swipeRightDirection = getSwipeDirection(swipeRight, swipeDistance); + const swipeDirection = getSwipeDirection(swipe, swipeDistance); + const swipeRightDirection = getSwipeDirection(swipeRight, swipeDistance); expect(swipeDirection).to.equal('left'); expect(swipeRightDirection).to.equal('right'); expect(swipeDistance.xDistance).to.be.greaterThan(50); @@ -149,7 +149,7 @@ describe('Carousel', () => { it('Mobile swipe distance end is zero', () => { const swipeDistance = {}; - const swipe = {xMin: 50, xStart: 2402, xEnd: 0}; + const swipe = { xMin: 50, xStart: 2402, xEnd: 0 }; swipeDistance.xDistance = getSwipeDistance(swipe.xStart, swipe.xEnd); expect(swipeDistance.xDistance).to.equal(0); }); diff --git a/test/blocks/commerce/commerce.test.js b/test/blocks/commerce/commerce.test.js index 2a3871cb9c2..7299b5f3b5a 100644 --- a/test/blocks/commerce/commerce.test.js +++ b/test/blocks/commerce/commerce.test.js @@ -89,12 +89,8 @@ describe('decorateSearch', () => { const searchWrapper = el.querySelector('.offer-search-wrapper'); const offerDetailsWrapper = el.querySelector('.offer-details-wrapper'); const input = searchWrapper.querySelector('.offer-search'); - const e = new KeyboardEvent("keyup", {bubbles : false, cancelable : true, key : "Q", shiftKey : false}); - Object.defineProperty(e, 'target', { - value: { - value: 'Q', - } - }); + const e = new KeyboardEvent('keyup', { bubbles: false, cancelable: true, key: 'Q', shiftKey: false }); + Object.defineProperty(e, 'target', { value: { value: 'Q' } }); input.dispatchEvent(e); let h4 = el.querySelector('h4'); expect(h4).to.equal(null); diff --git a/test/blocks/faas/utils.test.js b/test/blocks/faas/utils.test.js index 963ce09507d..182dd7860d0 100644 --- a/test/blocks/faas/utils.test.js +++ b/test/blocks/faas/utils.test.js @@ -67,7 +67,7 @@ describe('Faas', () => { expect(formWrapperEl.classList.contains('column1')).to.equal(true); expect(formWrapperEl.classList.contains('gated')).to.equal(false); }); - + it('FaaS Complete', async () => { let newState = '{"l":"en_us","d":"/resources/guides/data-retails-most-important-inventory/thank-you.html","ar":true,"test":false,"q":{},"pc":{"1":"js","2":"faas_submission","3":"sfdc","4":"demandbase","5":"clearbit"},"p":{"js":{"32":"unknown","36":"7015Y000003A7oBQAS","39":"","77":1,"78":1,"79":1,"90":"FAAS","92":2846,"93":"2847","94":3279,"173":"https://main--bacom--adobecom.hlx.page/resources/guides/data-retails-most-important-inventory"},"faas_submission":{},"sfdc":{"contactId":null},"demandbase":{}},"as":"true","o":{},"e":{},"cookie":{"p":{"js":{}}},"url":{"p":{"js":{"36":"70130000000kYe0AAE"}}},"js":{"l":"en_us","d":"/resources/guides/data-retails-most-important-inventory/thank-you.html","ar":true,"test":false,"q":{},"pc":{"1":"js","2":"faas_submission","3":"sfdc","4":"demandbase","5":"clearbit"},"p":{"js":{"36":"7015Y000003A7oBQAS","39":"","77":1,"78":1,"79":1,"90":"FAAS","92":2846,"93":"2847","94":3279}},"as":"true","o":{},"e":{},"cookie":{"p":{"js":{}}},"url":{"p":{"js":{"36":"70130000000kYe0AAE"}}},"onetrust_advertising_acceptance":"no","onetrust_performance_acceptance":"no","onetrust_functionality_acceptance":"no","clearbitStep":1,"formTag":"faas-Offer","id":"79","_fc":1,"complete":false,"title":"Please share some contact information to download the guide.","style_layout":"column2","cleabitStyle":"Cleabit Style","title_size":"p","title_align":"left"},"onetrust_advertising_acceptance":"no","onetrust_performance_acceptance":"no","onetrust_functionality_acceptance":"no","clearbitStep":1,"formTag":"faas-Offer","id":"79","_fc":1,"complete":false,"title":"Please share some contact information to download the guide.","style_layout":"column2","cleabitStyle":"Cleabit Style","title_size":"p","title_align":"left"}'; newState = JSON.parse(newState); diff --git a/test/blocks/footer/footer.test.js b/test/blocks/footer/footer.test.js index 465af3f09e0..957eebbcf52 100644 --- a/test/blocks/footer/footer.test.js +++ b/test/blocks/footer/footer.test.js @@ -52,7 +52,7 @@ describe('Footer', () => { it('adds li', () => { expect(privacy.querySelector('li.footer-privacy-link')).not.to.be.null; }); - + it('supports second line of text', () => { expect(privacy.querySelector('p:nth-of-type(2)')).not.to.be.null; }); diff --git a/test/blocks/gnav/gnav-contextual-search.test.js b/test/blocks/gnav/gnav-contextual-search.test.js index 46ec4f3c400..2bc96aaa842 100644 --- a/test/blocks/gnav/gnav-contextual-search.test.js +++ b/test/blocks/gnav/gnav-contextual-search.test.js @@ -10,7 +10,7 @@ async function loadDefaultHtml() { await loadDefaultHtml(); const gnavMod = await import('../../../libs/blocks/gnav/gnav.js'); -const contextualMod = await import('../../../libs/blocks/gnav/gnav-contextual-search.js') +const contextualMod = await import('../../../libs/blocks/gnav/gnav-contextual-search.js'); let gnav; const conf = { locales: { '': { ietf: 'en-US', tk: 'hah7vzn.css' } } }; diff --git a/test/blocks/gnav/gnav-search.test.js b/test/blocks/gnav/gnav-search.test.js index 550353ef83e..384f6c0c445 100644 --- a/test/blocks/gnav/gnav-search.test.js +++ b/test/blocks/gnav/gnav-search.test.js @@ -1,7 +1,7 @@ import { readFile } from '@web/test-runner-commands'; import { expect } from '@esm-bundle/chai'; -import { setConfig, getConfig } from '../../../libs/utils/utils.js'; import sinon from 'sinon'; +import { setConfig, getConfig } from '../../../libs/utils/utils.js'; async function loadDefaultHtml() { document.head.innerHTML = await readFile({ path: './mocks/head.html' }); @@ -20,21 +20,15 @@ const config = getConfig(); async function mockAutoComplete(value) { sinon.stub(window, 'fetch'); - const fetchText = await readFile({ - path: `./mocks/autocomplete.${value}.json`, - }); - var res = new window.Response(fetchText, { - status: 200, - }); + const fetchText = await readFile({ path: `./mocks/autocomplete.${value}.json` }); + const res = new window.Response(fetchText, { status: 200 }); window.fetch.returns(Promise.resolve(res)); } describe('contextual search', () => { before(async () => { gnav = await gnavMod.default(document.querySelector('header')); - window.adobeid = { - locale: 'en_US' - } + window.adobeid = { locale: 'en_US' }; }); afterEach(() => { @@ -72,7 +66,7 @@ describe('contextual search', () => { expect(resultsEl.classList.contains('no-results')).to.be.false; expect(helpxUrl).to.contains(`https://helpx.adobe.com${locale.prefix}/globalsearch.html?q=${value}&start_index=0`); }); - + it('no results is shown when the input is empty', async () => { config.locale.contentRoot = '/test/blocks/gnav/mocks'; @@ -115,7 +109,7 @@ describe('contextual search', () => { }); const liEl = resultsEl.querySelector('li a'); - const [ariaLabel, helpxUrl] = ['aria-label', 'href'].map(x => liEl.getAttribute(x)); + const [ariaLabel, helpxUrl] = ['aria-label', 'href'].map((x) => liEl.getAttribute(x)); expect(ariaLabel).to.eq('Try our advanced search'); expect(helpxUrl).to.contains(`https://helpx.adobe.com${locale.prefix}/globalsearch.html?q=${value}&start_index=0`); diff --git a/test/blocks/gnav/gnav.test.js b/test/blocks/gnav/gnav.test.js index 9f19ef7bbb9..e1151f74eee 100644 --- a/test/blocks/gnav/gnav.test.js +++ b/test/blocks/gnav/gnav.test.js @@ -157,29 +157,28 @@ describe('Gnav', () => { }); describe('Localized Gnav', () => { - - before( async () => { + before(async () => { // Load Localized Gnav await loadDefaultHtml(); document.head.getElementsByTagName('meta')[0].setAttribute('content', '/test/blocks/gnav/mocks/simple-gnav'); - const localizedConfig = { locales: { '': { ietf: 'en-US', tk: 'hah7vzn.css' }, fi: { ietf: 'fi-FI', tk: 'aaz7dvd.css' }, } }; + const localizedConfig = { locales: { '': { ietf: 'en-US', tk: 'hah7vzn.css' }, fi: { ietf: 'fi-FI', tk: 'aaz7dvd.css' } } }; localizedConfig.pathname = '/fi/gnav'; localizedConfig.prodDomains = ['milo.adobe.com']; setConfig(localizedConfig); gnav = await mod.default(document.querySelector('header')); }); - after (async () => { + after(async () => { // reset to regular Gnav setConfig(config); await loadDefaultHtml(); gnav = await mod.default(document.querySelector('header')); - }) + }); it('Test Gnav Localized Links', async () => { const links = document.getElementById('localized-links').getElementsByTagName('a'); links.forEach((anchor) => { - expect(anchor.href.startsWith('https://milo.adobe.com/fi/'), "Menu Links should be localized").true; + expect(anchor.href.startsWith('https://milo.adobe.com/fi/'), 'Menu Links should be localized').true; }); }); @@ -188,24 +187,24 @@ describe('Localized Gnav', () => { .getElementsByTagName('a'); dntLinks.forEach((anchor) => { const dntLink = anchor.href; - expect(dntLink.startsWith('https://milo.adobe.com/fi/'), "Menu DNT Links should not be localized").false; - expect(dntLink.endsWith('#_dnt'), "#_dnt should be stripped").false; + expect(dntLink.startsWith('https://milo.adobe.com/fi/'), 'Menu DNT Links should not be localized').false; + expect(dntLink.endsWith('#_dnt'), '#_dnt should be stripped').false; }); }); it('Test Gnav Breadcrumb Links', async () => { const breadcrumbLinks = document.querySelector('header nav.breadcrumbs').getElementsByTagName('a'); breadcrumbLinks.forEach((anchor) => { - expect(anchor.href.startsWith('http://localhost:2000/fi/'), "Breadcrumb Links should be localized").true; + expect(anchor.href.startsWith('http://localhost:2000/fi/'), 'Breadcrumb Links should be localized').true; }); }); it('Test Gnav Cta Link', async () => { const ctaLink = document.querySelector('.gnav-cta').getElementsByTagName('a')[0]; - expect(ctaLink.href.startsWith('http://localhost:2000/fi/'), "Cta Link should be localized").true; + expect(ctaLink.href.startsWith('http://localhost:2000/fi/'), 'Cta Link should be localized').true; }); it('Test Gnav Brand Link', async () => { - expect(document.querySelector('.gnav-brand').href.startsWith('http://localhost:2000/fi/'), "Brand Link should be localized").true; + expect(document.querySelector('.gnav-brand').href.startsWith('http://localhost:2000/fi/'), 'Brand Link should be localized').true; }); }); diff --git a/test/blocks/iframe/iframe.test.js b/test/blocks/iframe/iframe.test.js index 143f9082be4..2b0b0465e7f 100644 --- a/test/blocks/iframe/iframe.test.js +++ b/test/blocks/iframe/iframe.test.js @@ -2,13 +2,13 @@ import { expect } from '@esm-bundle/chai'; import { setConfig } from '../../../libs/utils/utils.js'; const { default: init } = await import('../../../libs/blocks/iframe/iframe.js'); -const emptyHTML = `
`; +const emptyHTML = '
'; const blockHTML = ``; -const autoBlockHTML = `https://adobe-ideacloud.forgedx.com/adobe-adobe-magento/adobe-magento-hybrid/public/mx?SUID=6Bmhi16C730c3noGdPN385j4ZipffIAq`; +const autoBlockHTML = 'https://adobe-ideacloud.forgedx.com/adobe-adobe-magento/adobe-magento-hybrid/public/mx?SUID=6Bmhi16C730c3noGdPN385j4ZipffIAq'; describe('iframe', () => { it('does not render iframe when there are no links', async () => { diff --git a/test/blocks/marketo/mocks/marketo-utils.js b/test/blocks/marketo/mocks/marketo-utils.js index 64c0e311c1f..28bb451b7ac 100644 --- a/test/blocks/marketo/mocks/marketo-utils.js +++ b/test/blocks/marketo/mocks/marketo-utils.js @@ -1,26 +1,26 @@ import { stub } from 'sinon'; export const parseEncodedConfig = stub().returns({ - "field visibility.phone": "hidden", - "field filters.job_role": "all", - "field filters.functional_area": "all", - "field filters.industry": "all", - "field filters.products": "all", - "field visibility.demo": "visible", - "program.copartnernames": "", - "program.campaignids.external": "", - "program.campaignids.retouch": "", - "program.campaignids.onsite": "", - "program.additional form_id": "", - "form id": "1723", - "marketo munckin": "360-KCI-804", - "marketo host": "engage.adobe.com", - "form type": "marketo_form", - "form.subtype": "whitepaper_form", - "program.campaignids.sfdc": "7011p00000046jUAAQ", - "program.poi": "", - "title": "New Title", - "description": "New Description" + 'field visibility.phone': 'hidden', + 'field filters.job_role': 'all', + 'field filters.functional_area': 'all', + 'field filters.industry': 'all', + 'field filters.products': 'all', + 'field visibility.demo': 'visible', + 'program.copartnernames': '', + 'program.campaignids.external': '', + 'program.campaignids.retouch': '', + 'program.campaignids.onsite': '', + 'program.additional form_id': '', + 'form id': '1723', + 'marketo munckin': '360-KCI-804', + 'marketo host': 'engage.adobe.com', + 'form type': 'marketo_form', + 'form.subtype': 'whitepaper_form', + 'program.campaignids.sfdc': '7011p00000046jUAAQ', + 'program.poi': '', + title: 'New Title', + description: 'New Description', }); export const loadScript = stub().returns(new Promise((resolve) => { diff --git a/test/blocks/marquee/marquee.test.js b/test/blocks/marquee/marquee.test.js index 0f13ea7352b..309a1ecd503 100644 --- a/test/blocks/marquee/marquee.test.js +++ b/test/blocks/marquee/marquee.test.js @@ -78,7 +78,7 @@ describe('marquee', () => { init(marquee); expect(marquee.querySelector('.icon-area-multiple')).to.exist; }); - + it('using svg', () => { const marquee = document.getElementById('using-svgs'); init(marquee); diff --git a/test/blocks/read-more/read-more.test.js b/test/blocks/read-more/read-more.test.js index d3d5690318e..718642b910a 100644 --- a/test/blocks/read-more/read-more.test.js +++ b/test/blocks/read-more/read-more.test.js @@ -3,7 +3,7 @@ import { readFile } from '@web/test-runner-commands'; import sinon from 'sinon'; const ogDoc = document.body.innerHTML; -const { default: init } = await import('../../../libs/blocks/read-more/read-more.js') +const { default: init } = await import('../../../libs/blocks/read-more/read-more.js'); describe('init', () => { afterEach(() => { diff --git a/test/blocks/share/share.test.js b/test/blocks/share/share.test.js index 59beb051152..e25dc7e2615 100644 --- a/test/blocks/share/share.test.js +++ b/test/blocks/share/share.test.js @@ -61,7 +61,7 @@ describe('Share', () => { expect(re).to.exist; expect(tw).to.not.exist; }); - it("Inline variant (with inline siblings) creates an inline-wrapper element", async () => { + it('Inline variant (with inline siblings) creates an inline-wrapper element', async () => { const section = document.querySelector('.section.inline-has-siblings'); const shareEls = section.querySelectorAll('.share.inline'); shareEls.forEach(async (shareEl) => { diff --git a/test/blocks/text/text.test.js b/test/blocks/text/text.test.js index be6c633cea0..ae2a64c01a3 100644 --- a/test/blocks/text/text.test.js +++ b/test/blocks/text/text.test.js @@ -37,7 +37,7 @@ describe('text block', () => { const element = document.querySelector('.link-farm'); expect(element).to.exist; }); - + it('adds h3 elements when necessary', () => { const headingElements = document.querySelectorAll('.link-farm .foreground h3'); expect(headingElements.length).to.equal(4); @@ -48,9 +48,9 @@ describe('text block', () => { }); it('adds h3 as the first element in the div', () => { const divElements = document.querySelectorAll('.link-farm .foreground:nth-child(2) div'); - divElements.forEach(div => { + divElements.forEach((div) => { expect(div.children[0].tagName).to.equal('H3'); }); - }) + }); }); }); diff --git a/test/features/georoutingv2/georoutingv2.test.js b/test/features/georoutingv2/georoutingv2.test.js index b15597e3bf9..7d29dc4a95a 100644 --- a/test/features/georoutingv2/georoutingv2.test.js +++ b/test/features/georoutingv2/georoutingv2.test.js @@ -1,10 +1,10 @@ import { stub } from 'sinon'; import { expect } from '@esm-bundle/chai'; +import { setViewport } from '@web/test-runner-commands'; const { default: init, getCookie } = await import('../../../libs/features/georoutingv2/georoutingv2.js'); let { getMetadata } = await import('../../../libs/utils/utils.js'); const { createTag, loadStyle, loadBlock, setConfig } = await import('../../../libs/utils/utils.js'); -import { setViewport } from '@web/test-runner-commands'; const mockConfig = { locales: { diff --git a/test/utils/action.test.js b/test/utils/action.test.js index e27088b4aaf..978e058ec4b 100644 --- a/test/utils/action.test.js +++ b/test/utils/action.test.js @@ -1,29 +1,28 @@ import sinon from 'sinon'; import { expect } from '@esm-bundle/chai'; -import { debounce } from "../../libs/utils/action.js"; - +import { debounce } from '../../libs/utils/action.js'; describe('Action', () => { - it('Debounces callback correctly', async () => { - const clock = sinon.useFakeTimers({ - toFake: ['setTimeout'], - shouldAdvanceTime: true, - }); + it('Debounces callback correctly', async () => { + const clock = sinon.useFakeTimers({ + toFake: ['setTimeout'], + shouldAdvanceTime: true, + }); - const header = document.createElement('h2') - header.setAttribute('id', 'debounce'); - const setValue = () => { - header.textContent = 'debounced!'; - }; + const header = document.createElement('h2'); + header.setAttribute('id', 'debounce'); + const setValue = () => { + header.textContent = 'debounced!'; + }; - debounce(setValue, 300)(); + debounce(setValue, 300)(); - expect(header.textContent).to.equal(''); - clock.tick(100); - expect(header.textContent).to.equal(''); - clock.tick(300); - expect(header.textContent).to.equal('debounced!'); - header.remove(); - clock.restore(); - }); + expect(header.textContent).to.equal(''); + clock.tick(100); + expect(header.textContent).to.equal(''); + clock.tick(300); + expect(header.textContent).to.equal('debounced!'); + header.remove(); + clock.restore(); + }); }); diff --git a/test/utils/lanaDefaultOptions.test.js b/test/utils/lanaDefaultOptions.test.js index 2a992f4f1f7..324a9f5ec46 100644 --- a/test/utils/lanaDefaultOptions.test.js +++ b/test/utils/lanaDefaultOptions.test.js @@ -20,7 +20,7 @@ it('lana should load existing window.lana.options', async () => { sampleRate: 100, tags: '', implicitSampleRate: 100, - endpointStage: "https://www.stage.adobe.com/lana/ll", + endpointStage: 'https://www.stage.adobe.com/lana/ll', useProd: true, }); }); diff --git a/test/utils/richresults.test.js b/test/utils/richresults.test.js index d1db500b6d1..5fce3a1c0bc 100644 --- a/test/utils/richresults.test.js +++ b/test/utils/richresults.test.js @@ -54,7 +54,7 @@ describe('Rich Results', () => { await loadArea(document); const script = document.querySelector('script[type="application/ld+json"]'); expect(script).to.be.null; - expect( console.error.calledWith('Type Unsupported is not supported') ).to.be.true; + expect(console.error.calledWith('Type Unsupported is not supported')).to.be.true; }); it('add the Site Search Box rich results', async () => { @@ -70,9 +70,9 @@ describe('Rich Results', () => { '@type': 'SearchAction', target: { '@type': 'EntryPoint', - urlTemplate: 'https://query.example.com/search?q={search_term_string}' + urlTemplate: 'https://query.example.com/search?q={search_term_string}', }, - 'query-input': 'required name=search_term_string' + 'query-input': 'required name=search_term_string', }], }; expect(actual).to.deep.equal(expected); diff --git a/tools/caas-import/parseCaasConfig.js b/tools/caas-import/parseCaasConfig.js index 967e25bbdca..d9ac97cdf4a 100644 --- a/tools/caas-import/parseCaasConfig.js +++ b/tools/caas-import/parseCaasConfig.js @@ -99,7 +99,7 @@ const parseAndQuery = (str) => { : 'OR'; return { intraTagLogic, - andTags: q.split(` ${intraTagLogic} `) + andTags: q.split(` ${intraTagLogic} `), }; }); }; diff --git a/tools/send-to-caas/send-to-caas.js b/tools/send-to-caas/send-to-caas.js index f8c6fd48d64..0b74e463bef 100644 --- a/tools/send-to-caas/send-to-caas.js +++ b/tools/send-to-caas/send-to-caas.js @@ -2,9 +2,7 @@ /* global tingle */ /* eslint-disable no-alert */ -import { - getImsToken, -} from '../utils/utils.js'; +import { getImsToken } from '../utils/utils.js'; import { getCardMetadata, diff --git a/tools/utils/utils.js b/tools/utils/utils.js index fd5270bad69..5bbf1ecc49a 100644 --- a/tools/utils/utils.js +++ b/tools/utils/utils.js @@ -14,6 +14,4 @@ const getImsToken = async (loadScript) => { return window.adobeIMS?.getAccessToken()?.token; }; -export { - getImsToken, -}; +export { getImsToken };