@coveo/quantic 3.33.0 → 3.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/force-app/main/default/lwc/quanticAriaLive/__tests__/quanticAriaLive.test.js +106 -0
- package/force-app/main/default/lwc/quanticBreadcrumbManager/__tests__/quanticBreadcrumbManager.test.js +752 -0
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +76 -0
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/pageObject.ts +282 -0
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +167 -0
- package/force-app/main/default/lwc/quanticCarousel/__tests__/quanticCarousel.test.js +262 -0
- package/force-app/main/default/lwc/quanticCaseClassification/__tests__/quanticCaseClassification.test.js +819 -0
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/data.ts +23 -0
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/fixture.ts +51 -0
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/pageObject.ts +152 -0
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/quanticCaseClassification.e2e.ts +269 -0
- package/force-app/main/default/lwc/quanticCategoryFacet/__tests__/quanticCategoryFacet.test.js +1183 -0
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +27 -0
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +75 -0
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/pageObject.ts +55 -0
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +199 -0
- package/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js +371 -0
- package/force-app/main/default/lwc/quanticColoredResultBadge/__tests__/quanticColoredResultBadge.test.js +212 -0
- package/force-app/main/default/lwc/quanticDateFacet/__tests__/quanticDateFacet.test.js +688 -0
- package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +24 -0
- package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +68 -0
- package/force-app/main/default/lwc/quanticDateFacet/e2e/pageObject.ts +27 -0
- package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +145 -0
- package/force-app/main/default/lwc/quanticDidYouMean/__tests__/quanticDidYouMean.test.js +348 -0
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/data.ts +48 -0
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/fixture.ts +80 -0
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/pageObject.ts +173 -0
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/quanticDidYouMean.e2e.ts +219 -0
- package/force-app/main/default/lwc/quanticDocumentSuggestion/__tests__/quanticDocumentSuggestion.test.js +404 -0
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/fixture.ts +38 -0
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/pageObject.ts +52 -0
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/quanticDocumentSuggestion.e2e.ts +102 -0
- package/force-app/main/default/lwc/quanticFacet/__tests__/quanticFacet.test.js +1105 -0
- package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +21 -0
- package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +73 -0
- package/force-app/main/default/lwc/quanticFacet/e2e/pageObject.ts +67 -0
- package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +208 -0
- package/force-app/main/default/lwc/quanticFacetCaption/__tests__/quanticFacetCaption.test.js +28 -0
- package/force-app/main/default/lwc/quanticFacetManager/__tests__/quanticFacetManager.test.js +178 -0
- package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +64 -0
- package/force-app/main/default/lwc/quanticFacetManager/e2e/pageObject.ts +23 -0
- package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +82 -0
- package/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js +392 -0
- package/force-app/main/default/lwc/quanticFeedbackModal/__tests__/quanticFeedbackModal.test.js +448 -0
- package/force-app/main/default/lwc/quanticFeedbackModalQna/__tests__/quanticFeedbackModalQna.test.js +298 -0
- package/force-app/main/default/lwc/quanticFoldedResultList/__tests__/quanticFoldedResultList.test.js +323 -0
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/fixture.ts +70 -0
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/pageObject.ts +81 -0
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/quanticFoldedResultList.e2e.ts +69 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +1158 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/data.ts +56 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture.ts +185 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +451 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswer.e2e.ts +337 -0
- package/force-app/main/default/lwc/quanticGeneratedAnswerContent/__tests__/quanticGeneratedAnswerContent.test.js +151 -0
- package/force-app/main/default/lwc/quanticHeading/__tests__/quanticHeading.test.js +71 -0
- package/force-app/main/default/lwc/quanticHeadlessLoader/__tests__/quanticHeadlessLoader.test.js +651 -0
- package/force-app/main/default/lwc/quanticInsightInterface/__tests__/quanticInsightInterface.test.js +194 -0
- package/force-app/main/default/lwc/quanticInsightSummary/__tests__/quanticInsightSummary.test.js +230 -0
- package/force-app/main/default/lwc/quanticModal/__tests__/quanticModal.test.js +205 -0
- package/force-app/main/default/lwc/quanticNotifications/__tests__/quanticNotifications.test.js +309 -0
- package/force-app/main/default/lwc/quanticNotifications/e2e/fixture.ts +58 -0
- package/force-app/main/default/lwc/quanticNotifications/e2e/pageObject.ts +55 -0
- package/force-app/main/default/lwc/quanticNotifications/e2e/quanticNotifications.e2e.ts +47 -0
- package/force-app/main/default/lwc/quanticNumericFacet/__tests__/quanticNumericFacet.test.js +953 -0
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +28 -0
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +71 -0
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/pageObject.ts +59 -0
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +164 -0
- package/force-app/main/default/lwc/quanticPager/__tests__/quanticPager.test.js +430 -0
- package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +65 -0
- package/force-app/main/default/lwc/quanticPager/e2e/pageObject.ts +69 -0
- package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +106 -0
- package/force-app/main/default/lwc/quanticPlaceholder/__tests__/quanticPlaceholder.test.js +47 -0
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/defaultTestCase.json +13 -0
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/youtubeTestCase.json +14 -0
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js +82 -0
- package/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js +273 -0
- package/force-app/main/default/lwc/quanticRecentQueriesList/__tests__/quanticRecentQueriesList.test.js +448 -0
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/fixture.ts +42 -0
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/pageObject.ts +55 -0
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/quanticRecentQueriesList.e2e.ts +93 -0
- package/force-app/main/default/lwc/quanticRecentResultsList/__tests__/quanticRecentResultsList.test.js +516 -0
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/fixture.ts +42 -0
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/pageObject.ts +61 -0
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/quanticRecentResultsList.e2e.ts +48 -0
- package/force-app/main/default/lwc/quanticRecommendationList/__tests__/quanticRecommendationList.test.js +491 -0
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/fixture.ts +35 -0
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/pageObject.ts +52 -0
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/quanticRecommendationList.e2e.ts +53 -0
- package/force-app/main/default/lwc/quanticRefineModalContent/__tests__/quanticRefineModalContent.test.js +747 -0
- package/force-app/main/default/lwc/quanticRefineToggle/__tests__/quanticRefineToggle.test.js +542 -0
- package/force-app/main/default/lwc/quanticResultAction/__tests__/quanticResultAction.test.js +262 -0
- package/force-app/main/default/lwc/quanticResultActionBar/__tests__/quanticResultActionBar.test.js +141 -0
- package/force-app/main/default/lwc/quanticResultChildren/__tests__/quanticResultChildren.test.js +340 -0
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/__tests__/quanticResultCopyToClipboard.test.js +300 -0
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/fixture.ts +46 -0
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/pageObject.ts +49 -0
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/quanticResultCopyToClipboard.e2e.ts +40 -0
- package/force-app/main/default/lwc/quanticResultDate/__tests__/quanticResultDate.test.js +144 -0
- package/force-app/main/default/lwc/quanticResultField/__tests__/quanticResultField.test.js +120 -0
- package/force-app/main/default/lwc/quanticResultHighlightedTextField/__tests__/quanticResultHighlightedTextField.test.js +209 -0
- package/force-app/main/default/lwc/quanticResultLink/__tests__/quanticResultLink.test.js +261 -0
- package/force-app/main/default/lwc/quanticResultList/__tests__/quanticResultList.test.js +342 -0
- package/force-app/main/default/lwc/quanticResultList/e2e/fixture.ts +66 -0
- package/force-app/main/default/lwc/quanticResultList/e2e/pageObject.ts +81 -0
- package/force-app/main/default/lwc/quanticResultList/e2e/quanticResultList.e2e.ts +69 -0
- package/force-app/main/default/lwc/quanticResultMultiValueText/__tests__/quanticResultMultiValueText.test.js +235 -0
- package/force-app/main/default/lwc/quanticResultNumber/__tests__/quanticResultNumber.test.js +144 -0
- package/force-app/main/default/lwc/quanticResultPrintableUri/__tests__/quanticResultPrintableUri.test.js +324 -0
- package/force-app/main/default/lwc/quanticResultQuickview/__tests__/quanticResultQuickview.test.js +301 -0
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/fixture.ts +81 -0
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/pageObject.ts +38 -0
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/quanticResultQuickView.e2e.ts +66 -0
- package/force-app/main/default/lwc/quanticResultTemplate/__tests__/quanticResultTemplate.test.js +90 -0
- package/force-app/main/default/lwc/quanticResultText/__tests__/quanticResultText.test.js +155 -0
- package/force-app/main/default/lwc/quanticResultsPerPage/__tests__/quanticResultsPerPage.test.js +464 -0
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/fixture.ts +74 -0
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/pageObject.ts +85 -0
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/quanticResultsPerPage.e2e.ts +97 -0
- package/force-app/main/default/lwc/quanticSearchBox/__tests__/quanticSearchBox.test.js +487 -0
- package/force-app/main/default/lwc/quanticSearchBox/e2e/fixture.ts +84 -0
- package/force-app/main/default/lwc/quanticSearchBox/e2e/pageObject.ts +45 -0
- package/force-app/main/default/lwc/quanticSearchBox/e2e/quanticSearchBox.e2e.ts +159 -0
- package/force-app/main/default/lwc/quanticSearchBoxInput/__tests__/quanticSearchBoxInput.test.js +743 -0
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/__tests__/quanticSearchBoxSuggestionsList.test.js +571 -0
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/fixture.ts +110 -0
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/pageObject.ts +113 -0
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/quanticSearchBoxSuggestionsList.e2e.ts +299 -0
- package/force-app/main/default/lwc/quanticSmartSnippet/__tests__/quanticSmartSnippet.test.js +341 -0
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/data.ts +21 -0
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/fixture.ts +91 -0
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/pageObject.ts +196 -0
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts +192 -0
- package/force-app/main/default/lwc/quanticSmartSnippetAnswer/__tests__/quanticSmartSnippetAnswer.test.js +126 -0
- package/force-app/main/default/lwc/quanticSmartSnippetSource/__tests__/quanticSmartSnippetSource.test.js +290 -0
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/__tests__/quanticSmartSnippetSuggestions.test.js +329 -0
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/data.ts +31 -0
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/fixture.ts +93 -0
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/pageObject.ts +160 -0
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/quanticSmartSnippetSuggestions.e2e.ts +127 -0
- package/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js +416 -0
- package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +61 -0
- package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +89 -0
- package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +91 -0
- package/force-app/main/default/lwc/quanticSourceCitations/__tests__/quanticSourceCitations.test.js +136 -0
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js +387 -0
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/fixture.ts +53 -0
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/pageObject.ts +54 -0
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/quanticStandaloneSearchBox.e2e.ts +72 -0
- package/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js +222 -0
- package/force-app/main/default/lwc/quanticSummary/__tests__/quanticSummary.test.js +244 -0
- package/force-app/main/default/lwc/quanticTab/__tests__/quanticTab.test.js +333 -0
- package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +56 -0
- package/force-app/main/default/lwc/quanticTab/e2e/pageObject.ts +68 -0
- package/force-app/main/default/lwc/quanticTab/e2e/quanticTab.e2e.ts +72 -0
- package/force-app/main/default/lwc/quanticTabBar/__tests__/quanticTabBar.test.js +331 -0
- package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +61 -0
- package/force-app/main/default/lwc/quanticTabBar/e2e/pageObject.ts +80 -0
- package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +171 -0
- package/force-app/main/default/lwc/quanticTimeframeFacet/__tests__/quanticTimeframeFacet.test.js +1037 -0
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +58 -0
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/pageObject.ts +43 -0
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +160 -0
- package/force-app/main/default/lwc/quanticTooltip/__tests__/quanticTooltip.test.js +107 -0
- package/force-app/main/default/lwc/quanticUserAction/__tests__/quanticUserAction.test.js +427 -0
- package/force-app/main/default/lwc/quanticUserActionsSession/__tests__/quanticUserActionsSession.test.js +269 -0
- package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/data/userActionsState.json +89 -0
- package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/quanticUserActionsTimeline.test.js +511 -0
- package/force-app/main/default/lwc/quanticUserActionsToggle/__tests__/quanticUserActionsToggle.test.js +229 -0
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/data.ts +32 -0
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/fixture.ts +32 -0
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/pageObject.ts +71 -0
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/quanticUserActionsToggle.e2e.ts +39 -0
- package/force-app/main/default/lwc/quanticUtils/__tests__/citationAnchoringUtils.test.js +84 -0
- package/force-app/main/default/lwc/quanticUtils/__tests__/facetDependenciesUtils.test.js +92 -0
- package/force-app/main/default/lwc/quanticUtils/__tests__/markdownUtils.test.js +71 -0
- package/force-app/main/default/lwc/quanticUtils/__tests__/quanticUtils.test.js +223 -0
- package/force-app/main/default/lwc/quanticViewedByCustomerBadge/__tests__/quanticViewedByCustomerBadge.test.js +131 -0
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/case-assist-engine/case-assist-engine.d.ts +3 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/commerce-engine/commerce-engine.d.ts +16 -16
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/common-reducers.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/insight-engine/insight-engine.d.ts +5 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/recommendation-engine/recommendation-engine.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/search-engine/search-engine.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/store.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/facets/headless-core-commerce-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/headless-core-range-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/actions-history/ipx-actions-history-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/advanced-search-queries/advanced-search-queries-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/attached-results/attached-results-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/case-assist-configuration/case-assist-configuration-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/case-context/case-context-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/case-field/case-field-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/case-field/case-field-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/case-input/case-input-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/configuration/configuration-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/cart/cart-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/cart/cart-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/context-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/did-you-mean/did-you-mean-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/facet-search-set/commerce-facet-search-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/facet-set/facet-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/field-suggestions-order/field-suggestions-order-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/numeric-facet/manual-numeric-facet-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/instant-products/instant-products-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/pagination/pagination-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/parameters/parameters-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product/product-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-listing/product-listing-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-listing/product-listing-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/query/query-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/query-suggest/query-suggest-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/recent-queries/recent-queries-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/recommendations/recommendations-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/recommendations/recommendations-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/search/search-actions.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/search/search-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/sort/sort-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/standalone-search-box-set/standalone-search-box-set-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/standalone-search-box-set/standalone-search-box-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/triggers/triggers-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/context/context-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/debug/debug-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/debug/version-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/dictionary-field-context/dictionary-field-context-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/did-you-mean/did-you-mean-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/document-suggestion/document-suggestion-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/document-suggestion/document-suggestion-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/excerpt-length/excerpt-length-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facet-options/facet-options-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/automatic-facet-set/automatic-facet-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/category-facet-set/category-facet-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-order/facet-order-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-search-set/category/category-facet-search-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-search-set/generic/generic-facet-search-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-search-set/specific/specific-facet-search-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-set/facet-set-controller-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-set/facet-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/range-facets/date-facet-set/date-facet-controller-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/range-facets/date-facet-set/date-facet-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/range-facets/numeric-facet-set/numeric-facet-controller-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/range-facets/numeric-facet-set/numeric-facet-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/fields/fields-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/fields/fields-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/folding/folding-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/folding/folding-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/folding/insight-folding-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/history/history-actions.d.ts +3 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/history/history-slice.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-configuration/insight-configuration-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-interface/insight-interface-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-interface/insight-interface-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/insight-search-actions.d.ts +5 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/legacy/insight-search-actions.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-user-actions/insight-user-actions-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-user-actions/insight-user-actions-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/instant-results/instant-results-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/pagination/pagination-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/pipeline/pipeline-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/query/query-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/query-set/query-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/query-suggest/query-suggest-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/query-suggest/query-suggest-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/question-answering/question-answering-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/recent-queries/recent-queries-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/recent-results/recent-results-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/recommendation/recommendation-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/recommendation/recommendation-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/result-preview/result-preview-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/result-preview/result-preview-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/legacy/search-actions.d.ts +5 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-actions.d.ts +6 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search-hub/search-hub-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/sort-criteria/sort-criteria-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/standalone-search-box-set/standalone-search-box-set-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/standalone-search-box-set/standalone-search-box-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/static-filter-set/static-filter-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/tab-set/tab-set-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/triggers/triggers-slice.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/factories/build-factory.d.ts +6 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/common/access-token-manager.d.ts +19 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +4 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/common/access-token-manager.d.ts +19 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/engine/search-engine.ssr.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-ssr-controller-definitions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/headless.js +2 -2
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +2 -2
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +2 -2
- package/package.json +46 -44
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const facetData = {
|
|
2
|
+
facetId: 'geographicalhierarchy',
|
|
3
|
+
field: 'geographicalhierarchy',
|
|
4
|
+
moreValuesAvailable: true,
|
|
5
|
+
values: [
|
|
6
|
+
{
|
|
7
|
+
value: 'North America',
|
|
8
|
+
state: 'idle',
|
|
9
|
+
numberOfResults: 112,
|
|
10
|
+
children: [],
|
|
11
|
+
path: ['North America'],
|
|
12
|
+
isLeafValue: false,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: 'Africa',
|
|
16
|
+
state: 'idle',
|
|
17
|
+
numberOfResults: 58,
|
|
18
|
+
children: [],
|
|
19
|
+
path: ['Africa'],
|
|
20
|
+
isLeafValue: false,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
indexScore: 0.40500903971252294,
|
|
24
|
+
label: 'Object type',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default facetData;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {CategoryFacetObject} from './pageObject';
|
|
2
|
+
import {useCaseEnum} from '../../../../../../playwright/utils/useCase';
|
|
3
|
+
import {InsightSetupObject} from '../../../../../../playwright/page-object/insightSetupObject';
|
|
4
|
+
import {
|
|
5
|
+
searchRequestRegex,
|
|
6
|
+
insightSearchRequestRegex,
|
|
7
|
+
} from '../../../../../../playwright/utils/requests';
|
|
8
|
+
import {BaseFacetObject} from '../../../../../../playwright/page-object/baseFacetObject';
|
|
9
|
+
import facetData from './data';
|
|
10
|
+
import {facetBase} from '../../../../../../playwright/fixtures/baseFacetFixture';
|
|
11
|
+
|
|
12
|
+
const pageUrl = 's/quantic-category-facet';
|
|
13
|
+
|
|
14
|
+
interface FacetOptions {
|
|
15
|
+
value?: string;
|
|
16
|
+
caption?: string;
|
|
17
|
+
withSearch?: boolean;
|
|
18
|
+
numberOfValues?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type QuanticFacetE2EFixtures = {
|
|
22
|
+
facet: CategoryFacetObject;
|
|
23
|
+
options: Partial<FacetOptions>;
|
|
24
|
+
insightSetup?: InsightSetupObject;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const testSearch = facetBase.extend<QuanticFacetE2EFixtures>({
|
|
28
|
+
options: {},
|
|
29
|
+
facetResponseMock: [facetData],
|
|
30
|
+
baseFacet: async ({page}, use) => {
|
|
31
|
+
await use(new BaseFacetObject(page, searchRequestRegex));
|
|
32
|
+
},
|
|
33
|
+
facet: async (
|
|
34
|
+
{page, options, configuration, baseFacet, urlHash, facetResponseMock},
|
|
35
|
+
use
|
|
36
|
+
) => {
|
|
37
|
+
await page.goto(
|
|
38
|
+
`${pageUrl}${options.caption ? '-with-captions' : ''}#${urlHash ? urlHash : ''}`
|
|
39
|
+
);
|
|
40
|
+
if (facetResponseMock) {
|
|
41
|
+
await baseFacet.mockSearchWithFacetResponse(facetResponseMock);
|
|
42
|
+
}
|
|
43
|
+
configuration.configure(options);
|
|
44
|
+
await baseFacet.waitForSearchResponse();
|
|
45
|
+
|
|
46
|
+
await use(new CategoryFacetObject(page));
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const testInsight = facetBase.extend<QuanticFacetE2EFixtures>({
|
|
51
|
+
options: {},
|
|
52
|
+
facetResponseMock: [facetData],
|
|
53
|
+
baseFacet: async ({page}, use) => {
|
|
54
|
+
await use(new BaseFacetObject(page, insightSearchRequestRegex));
|
|
55
|
+
},
|
|
56
|
+
insightSetup: async ({page}, use) => {
|
|
57
|
+
await use(new InsightSetupObject(page));
|
|
58
|
+
},
|
|
59
|
+
facet: async (
|
|
60
|
+
{page, options, baseFacet, configuration, insightSetup, facetResponseMock},
|
|
61
|
+
use
|
|
62
|
+
) => {
|
|
63
|
+
await page.goto(`${pageUrl}${options.caption ? '-with-captions' : ''}`);
|
|
64
|
+
if (facetResponseMock) {
|
|
65
|
+
await baseFacet.mockSearchWithFacetResponse(facetResponseMock);
|
|
66
|
+
}
|
|
67
|
+
configuration.configure({...options, useCase: useCaseEnum.insight});
|
|
68
|
+
await insightSetup?.waitForInsightInterfaceInitialization();
|
|
69
|
+
await baseFacet.performSearch();
|
|
70
|
+
await baseFacet.waitForSearchResponse();
|
|
71
|
+
await use(new CategoryFacetObject(page));
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export {expect} from '@playwright/test';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type {Locator, Page} from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
export class CategoryFacetObject {
|
|
4
|
+
constructor(public page: Page) {
|
|
5
|
+
this.page = page;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
get facet(): Locator {
|
|
9
|
+
return this.page.locator('c-quantic-category-facet');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get facetValue(): Locator {
|
|
13
|
+
return this.facet.locator('c-quantic-category-facet-value');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
get activeParent(): Locator {
|
|
17
|
+
return this.facet.getByTestId('facet__active-parent');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get allCategoriesButton(): Locator {
|
|
21
|
+
return this.facet.getByRole('button', {name: /all categories/i});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get showMoreFacetValuesButton(): Locator {
|
|
25
|
+
return this.facet.getByRole('button', {
|
|
26
|
+
name: /Show more values for the .* facet/i,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get showLessFacetValuesButton(): Locator {
|
|
31
|
+
return this.facet.getByRole('button', {
|
|
32
|
+
name: /Show less values for the .* facet/i,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get facetSearchBoxInput(): Locator {
|
|
37
|
+
return this.facet.getByTestId('facet__searchbox-input').locator('input');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get facetBreadcrumb(): Locator {
|
|
41
|
+
return this.page.getByTestId('category-facet-breadcrumb');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
facetBreadcrumbValueByIndex(index: number): Locator {
|
|
45
|
+
return this.facetBreadcrumb.locator('c-quantic-pill').nth(index);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async clickOnFacetValue(index: number): Promise<void> {
|
|
49
|
+
await this.facetValue.nth(index).click();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async fillFacetSearchBoxInput(query: string): Promise<void> {
|
|
53
|
+
await this.facetSearchBoxInput.fill(query);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import {testSearch, testInsight, expect} from './fixture';
|
|
2
|
+
import {
|
|
3
|
+
useCaseEnum,
|
|
4
|
+
useCaseTestCases,
|
|
5
|
+
} from '../../../../../../playwright/utils/useCase';
|
|
6
|
+
import facetData from './data';
|
|
7
|
+
|
|
8
|
+
const fixtures = {
|
|
9
|
+
search: testSearch,
|
|
10
|
+
insight: testInsight,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
useCaseTestCases.forEach((useCase) => {
|
|
14
|
+
let test = fixtures[useCase.value];
|
|
15
|
+
test.describe(`quantic category facet ${useCase.label}`, () => {
|
|
16
|
+
test.describe('when selecting a facet value and clicking the all categories button', () => {
|
|
17
|
+
test('should trigger a new search and log the corresponding UA analytics events', async ({
|
|
18
|
+
baseFacet,
|
|
19
|
+
facet,
|
|
20
|
+
page,
|
|
21
|
+
}) => {
|
|
22
|
+
const selectedIndex = 0;
|
|
23
|
+
const {facetId, field, values} = facetData;
|
|
24
|
+
const expectedFacetData = {
|
|
25
|
+
facetId,
|
|
26
|
+
facetField: field,
|
|
27
|
+
facetValue: values[selectedIndex].value,
|
|
28
|
+
};
|
|
29
|
+
const facetSelectUaRequest =
|
|
30
|
+
baseFacet.waitForFacetSelectUaAnalytics(expectedFacetData);
|
|
31
|
+
const firstSearchResponsePromise = baseFacet.waitForSearchResponse();
|
|
32
|
+
|
|
33
|
+
await facet.clickOnFacetValue(selectedIndex);
|
|
34
|
+
|
|
35
|
+
await facetSelectUaRequest;
|
|
36
|
+
const firstSearchResponse = await firstSearchResponsePromise;
|
|
37
|
+
const {analytics: analyticsForFacetSelect} =
|
|
38
|
+
baseFacet.extractDataFromResponse(firstSearchResponse);
|
|
39
|
+
expect(analyticsForFacetSelect.actionCause).toEqual('facetSelect');
|
|
40
|
+
if (useCase.value === useCaseEnum.search) {
|
|
41
|
+
expect(analyticsForFacetSelect.customData).toEqual(
|
|
42
|
+
expect.objectContaining(expectedFacetData)
|
|
43
|
+
);
|
|
44
|
+
const url = page.url();
|
|
45
|
+
expect(decodeURIComponent(url)).toContain(
|
|
46
|
+
`cf-${field}=${values[selectedIndex].value}`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const FacetClearAllUaRequest =
|
|
51
|
+
baseFacet.waitForFacetClearAllUaAnalytics({
|
|
52
|
+
facetId,
|
|
53
|
+
facetField: field,
|
|
54
|
+
});
|
|
55
|
+
const secondSearchResponsePromise = baseFacet.waitForSearchResponse();
|
|
56
|
+
|
|
57
|
+
await facet.allCategoriesButton.click();
|
|
58
|
+
|
|
59
|
+
await FacetClearAllUaRequest;
|
|
60
|
+
const secondSearchResponse = await secondSearchResponsePromise;
|
|
61
|
+
const {analytics: analyticsForFacetDeselect} =
|
|
62
|
+
baseFacet.extractDataFromResponse(secondSearchResponse);
|
|
63
|
+
expect(analyticsForFacetDeselect.actionCause).toEqual('facetClearAll');
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test.describe('when expanding and collapsing facet values using Show More/Less buttons', () => {
|
|
68
|
+
test.use({
|
|
69
|
+
options: {
|
|
70
|
+
numberOfValues: 2,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test('should fetch additional facet values and send correct UA analytics', async ({
|
|
75
|
+
baseFacet,
|
|
76
|
+
facet,
|
|
77
|
+
}) => {
|
|
78
|
+
const {facetId, field} = facetData;
|
|
79
|
+
const uaRequest = baseFacet.waitForShowMoreFacetResultsUaAnalytics({
|
|
80
|
+
facetId,
|
|
81
|
+
facetField: field,
|
|
82
|
+
});
|
|
83
|
+
const firstSearchResponsePromise = baseFacet.waitForSearchResponse();
|
|
84
|
+
|
|
85
|
+
await facet.showMoreFacetValuesButton.click();
|
|
86
|
+
|
|
87
|
+
await uaRequest;
|
|
88
|
+
const firstSearchResponse = await firstSearchResponsePromise;
|
|
89
|
+
const {analytics: analyticsForShowMore} =
|
|
90
|
+
baseFacet.extractDataFromResponse(firstSearchResponse);
|
|
91
|
+
expect(analyticsForShowMore.actionCause).toEqual(
|
|
92
|
+
'showMoreFacetResults'
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const showLessUaRequest =
|
|
96
|
+
baseFacet.waitForShowLessFacetResultsUaAnalytics({
|
|
97
|
+
facetId,
|
|
98
|
+
facetField: field,
|
|
99
|
+
});
|
|
100
|
+
const secondSearchResponsePromise = baseFacet.waitForSearchResponse();
|
|
101
|
+
|
|
102
|
+
await facet.showLessFacetValuesButton.click();
|
|
103
|
+
|
|
104
|
+
await showLessUaRequest;
|
|
105
|
+
const secondSearchResponse = await secondSearchResponsePromise;
|
|
106
|
+
const {analytics: analyticsForShowLess} =
|
|
107
|
+
baseFacet.extractDataFromResponse(secondSearchResponse);
|
|
108
|
+
expect(analyticsForShowLess.actionCause).toEqual(
|
|
109
|
+
'showLessFacetResults'
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test.describe('when a custom caption is provided', () => {
|
|
115
|
+
const exampleCaption = 'example caption';
|
|
116
|
+
const facetValueIndex = 0;
|
|
117
|
+
|
|
118
|
+
test.use({
|
|
119
|
+
options: {
|
|
120
|
+
caption: exampleCaption,
|
|
121
|
+
value: facetData.values[facetValueIndex].value,
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
test('should display the custom caption instead of the raw facet value', async ({
|
|
125
|
+
baseFacet,
|
|
126
|
+
facet,
|
|
127
|
+
}) => {
|
|
128
|
+
expect(facet.facetValue.nth(facetValueIndex)).toHaveText(
|
|
129
|
+
new RegExp(exampleCaption)
|
|
130
|
+
);
|
|
131
|
+
const {facetId, field, values} = facetData;
|
|
132
|
+
const expectedFacetData = {
|
|
133
|
+
facetId,
|
|
134
|
+
facetField: field,
|
|
135
|
+
facetValue: values[facetValueIndex].value,
|
|
136
|
+
};
|
|
137
|
+
const uaRequest =
|
|
138
|
+
baseFacet.waitForFacetSelectUaAnalytics(expectedFacetData);
|
|
139
|
+
const searchResponsePromise = baseFacet.waitForSearchResponse();
|
|
140
|
+
await facet.clickOnFacetValue(facetValueIndex);
|
|
141
|
+
await uaRequest;
|
|
142
|
+
const searchResponse = await searchResponsePromise;
|
|
143
|
+
const {analytics} = baseFacet.extractDataFromResponse(searchResponse);
|
|
144
|
+
|
|
145
|
+
if (useCase.value === useCaseEnum.search) {
|
|
146
|
+
expect(analytics.customData).toEqual(
|
|
147
|
+
expect.objectContaining(expectedFacetData)
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
expect(facet.facetBreadcrumbValueByIndex(facetValueIndex)).toHaveText(
|
|
151
|
+
exampleCaption
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
if (useCase.value === useCaseEnum.search) {
|
|
157
|
+
test.describe('when typing in the facet search box input', () => {
|
|
158
|
+
test.use({
|
|
159
|
+
options: {
|
|
160
|
+
withSearch: true,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
test('should fetch facet values according to the query typed', async ({
|
|
165
|
+
baseFacet,
|
|
166
|
+
facet,
|
|
167
|
+
}) => {
|
|
168
|
+
const {field: expectedField} = facetData;
|
|
169
|
+
const exampleQuery = 'test';
|
|
170
|
+
const facetSearchResponsePromise =
|
|
171
|
+
baseFacet.waitForFacetSearchResponse();
|
|
172
|
+
|
|
173
|
+
await facet.fillFacetSearchBoxInput(exampleQuery);
|
|
174
|
+
|
|
175
|
+
const facetSearchResponse = await facetSearchResponsePromise;
|
|
176
|
+
const {field, query} =
|
|
177
|
+
baseFacet.extractDataFromResponse(facetSearchResponse);
|
|
178
|
+
expect(field).toEqual(expectedField);
|
|
179
|
+
expect(query).toContain(exampleQuery);
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test.describe('with a selected value in the URL', () => {
|
|
184
|
+
const selectedIndex = 0;
|
|
185
|
+
const {field, values} = facetData;
|
|
186
|
+
test.use({
|
|
187
|
+
urlHash: `cf-${field}=${values[selectedIndex].value}`,
|
|
188
|
+
facetResponseMock: undefined,
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
test('should select the correct facet value', async ({facet}) => {
|
|
192
|
+
expect(facet.activeParent).toHaveText(
|
|
193
|
+
new RegExp(values[selectedIndex].value)
|
|
194
|
+
);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
});
|