@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,331 @@
|
|
|
1
|
+
/* eslint-disable no-import-assign */
|
|
2
|
+
import QuanticTabBar from '../quanticTabBar';
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import {createElement} from 'lwc';
|
|
5
|
+
|
|
6
|
+
const tabSlotWidth = 100;
|
|
7
|
+
const moreButtonWidth = 50;
|
|
8
|
+
let mockContainerWidth = 200;
|
|
9
|
+
let exampleTabSlots = [];
|
|
10
|
+
|
|
11
|
+
jest.mock('@salesforce/label/c.quantic_More', () => ({default: 'More'}), {
|
|
12
|
+
virtual: true,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
jest.mock('c/quanticUtils', () => ({
|
|
16
|
+
getAbsoluteWidth: jest.fn((element) => {
|
|
17
|
+
if (element?.tagName === 'C-QUANTIC-TAB') {
|
|
18
|
+
return tabSlotWidth;
|
|
19
|
+
} else if (element?.dataset?.testid === 'tab-bar_more-section') {
|
|
20
|
+
return moreButtonWidth;
|
|
21
|
+
}
|
|
22
|
+
return mockContainerWidth;
|
|
23
|
+
}),
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
const defaultOptions = {
|
|
27
|
+
lightTheme: false,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const selectors = {
|
|
31
|
+
tabBarContainer: '.tab-bar_container',
|
|
32
|
+
moreTabsSection: '[data-testid="tab-bar_more-section"]',
|
|
33
|
+
moreTabsButton: '[data-testid="tab-bar_more-button"]',
|
|
34
|
+
tabsDropdown: '.slds-dropdown-trigger',
|
|
35
|
+
tabItemsInDropdown: '.slds-dropdown__list li button',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const functionMocks = {
|
|
39
|
+
select: jest.fn(),
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
function createExampleTabSlots(numberOfSlots) {
|
|
43
|
+
const tabSlots = [];
|
|
44
|
+
|
|
45
|
+
for (let i = 0; i < numberOfSlots; i++) {
|
|
46
|
+
const exampleSlot = document.createElement('c-quantic-tab');
|
|
47
|
+
const value = `tab ${i + 1}`;
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
exampleSlot.getBoundingClientRect = () => ({right: (i + 1) * tabSlotWidth});
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
exampleSlot.label = value;
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
exampleSlot.expression = value;
|
|
54
|
+
// @ts-ignoreF
|
|
55
|
+
exampleSlot.select = () => {
|
|
56
|
+
functionMocks.select(i);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
exampleSlot.dataset.role = 'tab';
|
|
60
|
+
exampleSlot.dataset.value = value;
|
|
61
|
+
exampleSlot.dataset.label = value;
|
|
62
|
+
|
|
63
|
+
tabSlots.push(exampleSlot);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return tabSlots;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Mocks the return value of the assignedNodes method.
|
|
71
|
+
* @param {Array<Element>} assignedElements
|
|
72
|
+
*/
|
|
73
|
+
function mockSlotAssignedElements(assignedElements) {
|
|
74
|
+
HTMLSlotElement.prototype.assignedElements = function () {
|
|
75
|
+
return assignedElements;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function createTestComponent(options = defaultOptions, assignedElements = []) {
|
|
80
|
+
mockSlotAssignedElements(assignedElements);
|
|
81
|
+
|
|
82
|
+
const element = createElement('c-quantic-tab-bar', {
|
|
83
|
+
is: QuanticTabBar,
|
|
84
|
+
});
|
|
85
|
+
for (const [key, value] of Object.entries(options)) {
|
|
86
|
+
element[key] = value;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
document.body.appendChild(element);
|
|
90
|
+
|
|
91
|
+
// mocking the positioning of the tab bar container.
|
|
92
|
+
const tabBarContainer = element.shadowRoot.querySelector(
|
|
93
|
+
selectors.tabBarContainer
|
|
94
|
+
);
|
|
95
|
+
tabBarContainer.getBoundingClientRect = () => ({right: mockContainerWidth});
|
|
96
|
+
|
|
97
|
+
window.dispatchEvent(new CustomEvent('resize'));
|
|
98
|
+
return element;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Helper function to wait until the microtask queue is empty.
|
|
102
|
+
function flushPromises() {
|
|
103
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function cleanup() {
|
|
107
|
+
// The jsdom instance is shared across test cases in a single file so reset the DOM
|
|
108
|
+
while (document.body.firstChild) {
|
|
109
|
+
document.body.removeChild(document.body.firstChild);
|
|
110
|
+
}
|
|
111
|
+
jest.clearAllMocks();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
describe('c-quantic-tab-bar', () => {
|
|
115
|
+
afterEach(() => {
|
|
116
|
+
cleanup();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe("when the total tabs width is lower than the container's width", () => {
|
|
120
|
+
beforeEach(() => {
|
|
121
|
+
const numberOfTabs = 2;
|
|
122
|
+
exampleTabSlots = createExampleTabSlots(numberOfTabs);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('should display the tabs without displaying the more tabs section', async () => {
|
|
126
|
+
const element = createTestComponent(defaultOptions, exampleTabSlots);
|
|
127
|
+
await flushPromises();
|
|
128
|
+
|
|
129
|
+
const moreTabsSection = element.shadowRoot.querySelector(
|
|
130
|
+
selectors.moreTabsSection
|
|
131
|
+
);
|
|
132
|
+
expect(moreTabsSection).not.toBeNull();
|
|
133
|
+
const moreTabsSectionIsHidden = moreTabsSection.style.display === 'none';
|
|
134
|
+
expect(moreTabsSectionIsHidden).toBe(true);
|
|
135
|
+
|
|
136
|
+
const expectedNumberOfTabsToBeVisible = 2;
|
|
137
|
+
for (let i = 0; i < expectedNumberOfTabsToBeVisible - 1; i++) {
|
|
138
|
+
const tabIsVisible = exampleTabSlots[i].style.visibility === 'visible';
|
|
139
|
+
expect(tabIsVisible).toBe(true);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
describe('reactivity to window resize', () => {
|
|
144
|
+
afterAll(() => {
|
|
145
|
+
mockContainerWidth = 200;
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('should display the more tab section when the window is resized to a smaller width', async () => {
|
|
149
|
+
const element = createTestComponent(defaultOptions, exampleTabSlots);
|
|
150
|
+
await flushPromises();
|
|
151
|
+
|
|
152
|
+
const moreTabsSection = element.shadowRoot.querySelector(
|
|
153
|
+
selectors.moreTabsSection
|
|
154
|
+
);
|
|
155
|
+
expect(moreTabsSection).not.toBeNull();
|
|
156
|
+
const moreTabsSectionIsHidden =
|
|
157
|
+
moreTabsSection.style.display === 'none';
|
|
158
|
+
expect(moreTabsSectionIsHidden).toBe(true);
|
|
159
|
+
|
|
160
|
+
mockContainerWidth = 100;
|
|
161
|
+
// mocking the positioning of the tab bar container.
|
|
162
|
+
const tabBarContainer = element.shadowRoot.querySelector(
|
|
163
|
+
selectors.tabBarContainer
|
|
164
|
+
);
|
|
165
|
+
tabBarContainer.getBoundingClientRect = () => ({
|
|
166
|
+
right: mockContainerWidth,
|
|
167
|
+
});
|
|
168
|
+
window.dispatchEvent(new CustomEvent('resize'));
|
|
169
|
+
await flushPromises();
|
|
170
|
+
|
|
171
|
+
const moreTabsSectionIsVisible =
|
|
172
|
+
moreTabsSection.style.display === 'block';
|
|
173
|
+
expect(moreTabsSectionIsVisible).toBe(true);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it('should hide the more tab section when the window is resized to a bigger width', async () => {
|
|
177
|
+
const element = createTestComponent(defaultOptions, exampleTabSlots);
|
|
178
|
+
await flushPromises();
|
|
179
|
+
|
|
180
|
+
const moreTabsSection = element.shadowRoot.querySelector(
|
|
181
|
+
selectors.moreTabsSection
|
|
182
|
+
);
|
|
183
|
+
expect(moreTabsSection).not.toBeNull();
|
|
184
|
+
const moreTabsSectionIsVisible =
|
|
185
|
+
moreTabsSection.style.display === 'block';
|
|
186
|
+
expect(moreTabsSectionIsVisible).toBe(true);
|
|
187
|
+
|
|
188
|
+
mockContainerWidth = 300;
|
|
189
|
+
// mocking the positioning of the tab bar container.
|
|
190
|
+
const tabBarContainer = element.shadowRoot.querySelector(
|
|
191
|
+
selectors.tabBarContainer
|
|
192
|
+
);
|
|
193
|
+
tabBarContainer.getBoundingClientRect = () => ({
|
|
194
|
+
right: mockContainerWidth,
|
|
195
|
+
});
|
|
196
|
+
window.dispatchEvent(new CustomEvent('resize'));
|
|
197
|
+
await flushPromises();
|
|
198
|
+
|
|
199
|
+
const moreTabsSectionIsHidden =
|
|
200
|
+
moreTabsSection.style.display === 'none';
|
|
201
|
+
expect(moreTabsSectionIsHidden).toBe(true);
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
describe("when the total tabs width is higher than the container's width", () => {
|
|
207
|
+
beforeEach(() => {
|
|
208
|
+
const numberOfTabs = 3;
|
|
209
|
+
exampleTabSlots = createExampleTabSlots(numberOfTabs);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
it('should only display a sub set of tabs and display the more tabs button', async () => {
|
|
213
|
+
const element = createTestComponent(defaultOptions, exampleTabSlots);
|
|
214
|
+
await flushPromises();
|
|
215
|
+
|
|
216
|
+
const moreTabsSection = element.shadowRoot.querySelector(
|
|
217
|
+
selectors.moreTabsSection
|
|
218
|
+
);
|
|
219
|
+
expect(moreTabsSection).not.toBeNull();
|
|
220
|
+
const moreTabsSectionIsVisible =
|
|
221
|
+
moreTabsSection.style.display === 'block';
|
|
222
|
+
expect(moreTabsSectionIsVisible).toBe(true);
|
|
223
|
+
|
|
224
|
+
const expectedNumberOfTabsToBeVisible = 1;
|
|
225
|
+
const visibleTabs = exampleTabSlots.filter(
|
|
226
|
+
(tab) => tab.style.visibility === 'visible'
|
|
227
|
+
);
|
|
228
|
+
expect(visibleTabs.length).toBe(expectedNumberOfTabsToBeVisible);
|
|
229
|
+
|
|
230
|
+
const expectedNumberOfTabsToBeHidden = 2;
|
|
231
|
+
const hiddenTabs = exampleTabSlots.filter(
|
|
232
|
+
(tab) => tab.style.visibility === 'hidden'
|
|
233
|
+
);
|
|
234
|
+
expect(hiddenTabs.length).toBe(expectedNumberOfTabsToBeHidden);
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
it('should display the correct tabs in the tabs dropdown list', async () => {
|
|
238
|
+
const element = createTestComponent(defaultOptions, exampleTabSlots);
|
|
239
|
+
await flushPromises();
|
|
240
|
+
|
|
241
|
+
const tabItemsInDropdown = element.shadowRoot.querySelectorAll(
|
|
242
|
+
selectors.tabItemsInDropdown
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
const expectedNumberOfTabsToBeVisible = 1;
|
|
246
|
+
const expectedNumberOfTabsToBeHidden = 2;
|
|
247
|
+
|
|
248
|
+
expect(tabItemsInDropdown.length).toBe(expectedNumberOfTabsToBeHidden);
|
|
249
|
+
const tabsInDropdownLabels = Array.from(tabItemsInDropdown).map(
|
|
250
|
+
(tab) => tab.textContent
|
|
251
|
+
);
|
|
252
|
+
const expectedTabsInDropdownLabels = exampleTabSlots
|
|
253
|
+
.slice(expectedNumberOfTabsToBeVisible)
|
|
254
|
+
.map((tab) => tab.label);
|
|
255
|
+
expect(tabsInDropdownLabels).toEqual(expectedTabsInDropdownLabels);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('should open and close the tabs dropdown list after clicking the more tabs button', async () => {
|
|
259
|
+
const element = createTestComponent(defaultOptions, exampleTabSlots);
|
|
260
|
+
await flushPromises();
|
|
261
|
+
|
|
262
|
+
const moreTabsButton = element.shadowRoot.querySelector(
|
|
263
|
+
selectors.moreTabsButton
|
|
264
|
+
);
|
|
265
|
+
const tabsDropdown = element.shadowRoot.querySelector(
|
|
266
|
+
selectors.tabsDropdown
|
|
267
|
+
);
|
|
268
|
+
const expectedOpentabsDropdownCSSClass = 'slds-is-open';
|
|
269
|
+
|
|
270
|
+
expect(moreTabsButton).not.toBeNull();
|
|
271
|
+
expect(tabsDropdown).not.toBeNull();
|
|
272
|
+
expect(tabsDropdown.classList).not.toContain(
|
|
273
|
+
expectedOpentabsDropdownCSSClass
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
await moreTabsButton.click();
|
|
277
|
+
expect(tabsDropdown.classList).toContain(
|
|
278
|
+
expectedOpentabsDropdownCSSClass
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
await moreTabsButton.click();
|
|
282
|
+
expect(tabsDropdown.classList).not.toContain(
|
|
283
|
+
expectedOpentabsDropdownCSSClass
|
|
284
|
+
);
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
it('should call the select method of a tab when selecting it from the tabs dropdown list', async () => {
|
|
288
|
+
const element = createTestComponent(defaultOptions, exampleTabSlots);
|
|
289
|
+
await flushPromises();
|
|
290
|
+
|
|
291
|
+
const expectedNumberOfTabsToBeVisible = 1;
|
|
292
|
+
const expectedNumberOfTabsToBeHidden = 2;
|
|
293
|
+
|
|
294
|
+
const tabItemsInDropdown = element.shadowRoot.querySelectorAll(
|
|
295
|
+
selectors.tabItemsInDropdown
|
|
296
|
+
);
|
|
297
|
+
|
|
298
|
+
const exampleIndex = 0;
|
|
299
|
+
await tabItemsInDropdown[exampleIndex].click();
|
|
300
|
+
expect(tabItemsInDropdown.length).toBe(expectedNumberOfTabsToBeHidden);
|
|
301
|
+
expect(functionMocks.select).toHaveBeenCalledTimes(1);
|
|
302
|
+
expect(functionMocks.select).toHaveBeenCalledWith(
|
|
303
|
+
expectedNumberOfTabsToBeVisible + exampleIndex
|
|
304
|
+
);
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
describe('the lightTheme property', () => {
|
|
309
|
+
it('should display the component with the light theme styles when lightTheme is true', async () => {
|
|
310
|
+
const expectedDarkThemeClass = 'slds-theme_shade';
|
|
311
|
+
const element = createTestComponent({lightTheme: true});
|
|
312
|
+
await flushPromises();
|
|
313
|
+
|
|
314
|
+
const tabBarContainer = element.shadowRoot.querySelector(
|
|
315
|
+
selectors.tabBarContainer
|
|
316
|
+
);
|
|
317
|
+
expect(tabBarContainer.classList).not.toContain(expectedDarkThemeClass);
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
it('should display the component with the dark theme styles when lightTheme is false', async () => {
|
|
321
|
+
const expectedDarkThemeClass = 'slds-theme_shade';
|
|
322
|
+
const element = createTestComponent({lightTheme: false});
|
|
323
|
+
await flushPromises();
|
|
324
|
+
|
|
325
|
+
const tabBarContainer = element.shadowRoot.querySelector(
|
|
326
|
+
selectors.tabBarContainer
|
|
327
|
+
);
|
|
328
|
+
expect(tabBarContainer.classList).toContain(expectedDarkThemeClass);
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {TabBarObject} from './pageObject';
|
|
2
|
+
import {quanticBase} from '../../../../../../playwright/fixtures/baseFixture';
|
|
3
|
+
import {SearchObject} from '../../../../../../playwright/page-object/searchObject';
|
|
4
|
+
import {
|
|
5
|
+
searchRequestRegex,
|
|
6
|
+
insightSearchRequestRegex,
|
|
7
|
+
} from '../../../../../../playwright/utils/requests';
|
|
8
|
+
import {InsightSetupObject} from '../../../../../../playwright/page-object/insightSetupObject';
|
|
9
|
+
import {useCaseEnum} from '../../../../../../playwright/utils/useCase';
|
|
10
|
+
|
|
11
|
+
const pageUrl = 's/quantic-tab-bar';
|
|
12
|
+
|
|
13
|
+
interface TabBarOptions {
|
|
14
|
+
lightTheme: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type QuanticTabBarE2EFixtures = {
|
|
18
|
+
tabBar: TabBarObject;
|
|
19
|
+
search: SearchObject;
|
|
20
|
+
options: Partial<TabBarOptions>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type QuanticTabBarE2ESearchFixtures = QuanticTabBarE2EFixtures;
|
|
24
|
+
|
|
25
|
+
type QuanticTabBarE2EInsightFixtures = QuanticTabBarE2ESearchFixtures & {
|
|
26
|
+
insightSetup: InsightSetupObject;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const testSearch = quanticBase.extend<QuanticTabBarE2ESearchFixtures>({
|
|
30
|
+
options: {},
|
|
31
|
+
search: async ({page}, use) => {
|
|
32
|
+
await use(new SearchObject(page, searchRequestRegex));
|
|
33
|
+
},
|
|
34
|
+
tabBar: async ({page, options, configuration, search}, use) => {
|
|
35
|
+
await page.goto(pageUrl);
|
|
36
|
+
configuration.configure(options);
|
|
37
|
+
await search.waitForSearchResponse();
|
|
38
|
+
|
|
39
|
+
await use(new TabBarObject(page));
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const testInsight = quanticBase.extend<QuanticTabBarE2EInsightFixtures>({
|
|
44
|
+
options: {},
|
|
45
|
+
search: async ({page}, use) => {
|
|
46
|
+
await use(new SearchObject(page, insightSearchRequestRegex));
|
|
47
|
+
},
|
|
48
|
+
insightSetup: async ({page}, use) => {
|
|
49
|
+
await use(new InsightSetupObject(page));
|
|
50
|
+
},
|
|
51
|
+
tabBar: async ({page, options, search, configuration, insightSetup}, use) => {
|
|
52
|
+
await page.goto(pageUrl);
|
|
53
|
+
configuration.configure({...options, useCase: useCaseEnum.insight});
|
|
54
|
+
await insightSetup.waitForInsightInterfaceInitialization();
|
|
55
|
+
await search.performSearch();
|
|
56
|
+
await search.waitForSearchResponse();
|
|
57
|
+
await use(new TabBarObject(page));
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export {expect} from '@playwright/test';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type {Locator, Page, Request} from '@playwright/test';
|
|
2
|
+
import {isUaSearchEvent} from '../../../../../../playwright/utils/requests';
|
|
3
|
+
|
|
4
|
+
export class TabBarObject {
|
|
5
|
+
constructor(public page: Page) {
|
|
6
|
+
this.page = page;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
get tabBar(): Locator {
|
|
10
|
+
return this.page.locator('c-quantic-tab-bar');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get allTabs(): Locator {
|
|
14
|
+
return this.tabBar.locator('c-quantic-tab');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
get allVisibleTabs(): Locator {
|
|
18
|
+
return this.tabBar.locator('c-quantic-tab').filter({
|
|
19
|
+
has: this.page.locator(':visible'),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get activeTab(): Locator {
|
|
24
|
+
return this.tabBar.locator('c-quantic-tab').filter({
|
|
25
|
+
has: this.page.locator('.slds-is-active'),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get moreButton(): Locator {
|
|
30
|
+
return this.tabBar.getByTestId('tab-bar_more-button');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get dropdownContainer(): Locator {
|
|
34
|
+
return this.page.getByTestId('tab-bar_dropdown-container');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
get allDropdownOptions(): Locator {
|
|
38
|
+
return this.page.getByTestId('tab-bar_dropdown-item');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get tabBarContainer(): Locator {
|
|
42
|
+
return this.page.locator('.tab-bar_container');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
get tabBarDropdown(): Locator {
|
|
46
|
+
return this.tabBar.locator('.tab-bar_dropdown');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async clickMoreButton(): Promise<void> {
|
|
50
|
+
await this.moreButton.click();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async clickDropdownOption(optionIndex: number): Promise<void> {
|
|
54
|
+
await this.allDropdownOptions.nth(optionIndex).click();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async clickComponentContainer(): Promise<void> {
|
|
58
|
+
await this.tabBarContainer.click();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async waitForTabUaAnalytics(actionCause): Promise<Request> {
|
|
62
|
+
const uaRequest = this.page.waitForRequest((request) => {
|
|
63
|
+
if (isUaSearchEvent(request)) {
|
|
64
|
+
const requestBody = request.postDataJSON?.();
|
|
65
|
+
const expectedFields = {
|
|
66
|
+
actionCause: actionCause,
|
|
67
|
+
};
|
|
68
|
+
return Object.keys(expectedFields).every(
|
|
69
|
+
(key) => requestBody?.[key] === expectedFields[key]
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
});
|
|
74
|
+
return uaRequest;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async waitForDropdownOptionSelectUaAnalytics(): Promise<Request> {
|
|
78
|
+
return this.waitForTabUaAnalytics('interfaceChange');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import {testSearch, testInsight, expect} from './fixture';
|
|
2
|
+
import {useCaseTestCases} from '../../../../../../playwright/utils/useCase';
|
|
3
|
+
|
|
4
|
+
const fixtures = {
|
|
5
|
+
search: testSearch,
|
|
6
|
+
insight: testInsight,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const extraSmallViewportWidth = 200;
|
|
10
|
+
const smallViewportWidth = 260;
|
|
11
|
+
const mediumViewportWidth = 300;
|
|
12
|
+
const standardViewportHeight = 1080;
|
|
13
|
+
const expectedNumberOfTabs = 4;
|
|
14
|
+
|
|
15
|
+
const viewportTests = [
|
|
16
|
+
{
|
|
17
|
+
testDescribe: 'when the viewport is resized to a extra small width',
|
|
18
|
+
viewportWidth: extraSmallViewportWidth,
|
|
19
|
+
testLabel:
|
|
20
|
+
'should display only the selected tab and the more button without a label, the other tabs are in the dropdown',
|
|
21
|
+
expectedNumberOfTabsDisplayed: 1,
|
|
22
|
+
expectedMoreButtonLabel: '',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
testDescribe: 'when the viewport is resized to a small width',
|
|
26
|
+
viewportWidth: smallViewportWidth,
|
|
27
|
+
testLabel:
|
|
28
|
+
'should display only the selected tab and the more button with a label, the other tabs are in the dropdown',
|
|
29
|
+
expectedNumberOfTabsDisplayed: 1,
|
|
30
|
+
expectedMoreButtonLabel: 'More',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
testDescribe: 'when the viewport is resized to a medium width',
|
|
34
|
+
viewportWidth: mediumViewportWidth,
|
|
35
|
+
testLabel:
|
|
36
|
+
'should display only the first two tabs and the more button with a label, the other tabs are in the dropdown',
|
|
37
|
+
expectedNumberOfTabsDisplayed: 2,
|
|
38
|
+
expectedMoreButtonLabel: 'More',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
useCaseTestCases.forEach((useCase) => {
|
|
43
|
+
let test = fixtures[useCase.value];
|
|
44
|
+
test.describe(`quantic tab bar ${useCase.label}`, () => {
|
|
45
|
+
test.describe("when the container's width can fit all the tabs", () => {
|
|
46
|
+
test('should display all the tabs without displaying the dropdown list', async ({
|
|
47
|
+
tabBar,
|
|
48
|
+
}) => {
|
|
49
|
+
const tabBarElement = tabBar.tabBar;
|
|
50
|
+
await tabBarElement.scrollIntoViewIfNeeded();
|
|
51
|
+
const tabs = tabBar.allTabs;
|
|
52
|
+
expect(tabs).not.toBeNull();
|
|
53
|
+
expect(await tabs.count()).toEqual(expectedNumberOfTabs);
|
|
54
|
+
|
|
55
|
+
const isMoreDropdownVisible =
|
|
56
|
+
await tabBar.dropdownContainer.isVisible();
|
|
57
|
+
expect(isMoreDropdownVisible).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// Test different behaviors based on the viewport width.
|
|
62
|
+
viewportTests.forEach(
|
|
63
|
+
({
|
|
64
|
+
testDescribe,
|
|
65
|
+
viewportWidth,
|
|
66
|
+
testLabel,
|
|
67
|
+
expectedNumberOfTabsDisplayed,
|
|
68
|
+
expectedMoreButtonLabel,
|
|
69
|
+
}) => {
|
|
70
|
+
test.describe(testDescribe, () => {
|
|
71
|
+
test.use({
|
|
72
|
+
viewport: {width: viewportWidth, height: standardViewportHeight},
|
|
73
|
+
});
|
|
74
|
+
test(testLabel, async ({tabBar}) => {
|
|
75
|
+
const dropdownContainer = tabBar.dropdownContainer;
|
|
76
|
+
await dropdownContainer.scrollIntoViewIfNeeded();
|
|
77
|
+
|
|
78
|
+
const displayedTabs = tabBar.allVisibleTabs;
|
|
79
|
+
expect(displayedTabs).not.toBeNull();
|
|
80
|
+
expect(await displayedTabs.count()).toEqual(
|
|
81
|
+
expectedNumberOfTabsDisplayed
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
expect(await dropdownContainer.isVisible()).toBe(true);
|
|
85
|
+
|
|
86
|
+
await tabBar.clickMoreButton();
|
|
87
|
+
|
|
88
|
+
const tabsInDropdown = tabBar.allDropdownOptions;
|
|
89
|
+
expect(tabsInDropdown).not.toBeNull();
|
|
90
|
+
expect(await tabsInDropdown.count()).toEqual(
|
|
91
|
+
expectedNumberOfTabs - expectedNumberOfTabsDisplayed
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
expect(await tabBar.moreButton.textContent()).toEqual(
|
|
95
|
+
expectedMoreButtonLabel
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
test.describe('when the more button is clicked', () => {
|
|
103
|
+
// Using medium width (300px), 2 tabs should be displayed and 2 should be in the dropdown.
|
|
104
|
+
test.use({
|
|
105
|
+
viewport: {width: mediumViewportWidth, height: standardViewportHeight},
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test.describe('when a tab is selected from the dropdown list', () => {
|
|
109
|
+
test('should make the tab active, trigger a new search and send the correct analytics event', async ({
|
|
110
|
+
tabBar,
|
|
111
|
+
search,
|
|
112
|
+
}) => {
|
|
113
|
+
const expectedSelectedTabLabel = 'Tab 4';
|
|
114
|
+
const expectedNumberOfDropdownOptions = 2;
|
|
115
|
+
const expectedActionCause = 'interfaceChange';
|
|
116
|
+
const expectedTabValue = 'Tab 4';
|
|
117
|
+
|
|
118
|
+
const searchResponsePromise = search.waitForSearchResponse();
|
|
119
|
+
|
|
120
|
+
await tabBar.clickMoreButton();
|
|
121
|
+
const dropdownOptionsCount = await tabBar.allDropdownOptions.count();
|
|
122
|
+
expect(dropdownOptionsCount).not.toBeNull();
|
|
123
|
+
expect(dropdownOptionsCount).toEqual(expectedNumberOfDropdownOptions);
|
|
124
|
+
await tabBar.clickDropdownOption(1);
|
|
125
|
+
|
|
126
|
+
const activeTab = await tabBar.activeTab.textContent();
|
|
127
|
+
|
|
128
|
+
expect(activeTab).not.toBeNull();
|
|
129
|
+
expect(activeTab).toEqual(expectedSelectedTabLabel);
|
|
130
|
+
|
|
131
|
+
const searchResponse = await searchResponsePromise;
|
|
132
|
+
const searchResponseBody = searchResponse.request().postDataJSON();
|
|
133
|
+
|
|
134
|
+
expect(searchResponseBody).toEqual(
|
|
135
|
+
expect.objectContaining({
|
|
136
|
+
analytics: expect.objectContaining({
|
|
137
|
+
actionCause: expectedActionCause,
|
|
138
|
+
}),
|
|
139
|
+
tab: expectedTabValue,
|
|
140
|
+
})
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
const uaRequest =
|
|
144
|
+
await tabBar.waitForDropdownOptionSelectUaAnalytics();
|
|
145
|
+
const requestBody = uaRequest.postDataJSON?.();
|
|
146
|
+
|
|
147
|
+
expect(requestBody).not.toBeNull();
|
|
148
|
+
expect(requestBody.actionCause).toEqual(expectedActionCause);
|
|
149
|
+
expect(requestBody.customData.interfaceChangeTo).toEqual(
|
|
150
|
+
expectedTabValue
|
|
151
|
+
);
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test.describe('when the dropdown loses focus', () => {
|
|
157
|
+
test.use({
|
|
158
|
+
viewport: {width: mediumViewportWidth, height: standardViewportHeight},
|
|
159
|
+
});
|
|
160
|
+
test('should automatically close the dropdown list', async ({tabBar}) => {
|
|
161
|
+
await tabBar.clickMoreButton();
|
|
162
|
+
|
|
163
|
+
expect(await tabBar.tabBarDropdown.isVisible()).toBe(true);
|
|
164
|
+
|
|
165
|
+
await tabBar.clickComponentContainer();
|
|
166
|
+
|
|
167
|
+
expect(await tabBar.tabBarDropdown.isVisible()).toBe(false);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
});
|