@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,337 @@
|
|
|
1
|
+
import {testSearch, testInsight, expect} from './fixture';
|
|
2
|
+
import {useCaseTestCases} from '../../../../../../playwright/utils/useCase';
|
|
3
|
+
import genQaData from './data';
|
|
4
|
+
import {analyticsModeTest} from '../../../../../../playwright/utils/analyticsMode';
|
|
5
|
+
|
|
6
|
+
const fixtures = {
|
|
7
|
+
search: testSearch,
|
|
8
|
+
insight: testInsight,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const exampleAnswerConfigurationId = 'fc581be0-6e61-4039-ab26-a3f2f52f308f';
|
|
12
|
+
|
|
13
|
+
useCaseTestCases.forEach((useCase) => {
|
|
14
|
+
let test = fixtures[useCase.value];
|
|
15
|
+
|
|
16
|
+
test.describe(`quantic generated answer ${useCase.label}`, () => {
|
|
17
|
+
test.use({
|
|
18
|
+
genQaData,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
analyticsModeTest.forEach((analytics) => {
|
|
22
|
+
test.describe(analytics.label, () => {
|
|
23
|
+
test.use({
|
|
24
|
+
analyticsMode: analytics.mode,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const configurations = [
|
|
28
|
+
{
|
|
29
|
+
name: 'with answerConfigurationId',
|
|
30
|
+
options: {
|
|
31
|
+
answerConfigurationId: exampleAnswerConfigurationId,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'without answerConfigurationId',
|
|
36
|
+
options: {},
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
for (const config of configurations) {
|
|
41
|
+
test.describe(config.name, () => {
|
|
42
|
+
test.use({analyticsMode: analytics.mode, options: config.options});
|
|
43
|
+
|
|
44
|
+
test.describe('when the answer has been generated', () => {
|
|
45
|
+
test('should send a stream end analytics event', async ({
|
|
46
|
+
generatedAnswer,
|
|
47
|
+
}) => {
|
|
48
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
if (config.options.answerConfigurationId) {
|
|
52
|
+
test('should send searchboxSubmit as the action cause in the analytics payload of the generate request', async ({
|
|
53
|
+
generatedAnswer,
|
|
54
|
+
}) => {
|
|
55
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
56
|
+
const generateRequest =
|
|
57
|
+
await generatedAnswer.generateRequestPromise;
|
|
58
|
+
const generateRequestBody = generateRequest.postDataJSON();
|
|
59
|
+
expect(generateRequestBody.analytics.actionCause).toBe(
|
|
60
|
+
'searchboxSubmit'
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test.describe('when providing positive feedback', () => {
|
|
67
|
+
test('should send positive feedback analytics containing all details', async ({
|
|
68
|
+
generatedAnswer,
|
|
69
|
+
}) => {
|
|
70
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
71
|
+
const likeAnalyticRequestPromise =
|
|
72
|
+
generatedAnswer.waitForLikeGeneratedAnswerAnalytics();
|
|
73
|
+
await generatedAnswer.clickLikeButton();
|
|
74
|
+
await likeAnalyticRequestPromise;
|
|
75
|
+
|
|
76
|
+
const exampleDocumentUrl = 'https://www.coveo.com/';
|
|
77
|
+
const exampleDetails = 'example details...';
|
|
78
|
+
await generatedAnswer.fillFeedbackForm({
|
|
79
|
+
correctTopic: 'Yes',
|
|
80
|
+
hallucinationFree: 'Yes',
|
|
81
|
+
documented: 'Not sure',
|
|
82
|
+
readable: 'Yes',
|
|
83
|
+
});
|
|
84
|
+
await generatedAnswer.typeInFeedbackDocumentUrlInput(
|
|
85
|
+
exampleDocumentUrl
|
|
86
|
+
);
|
|
87
|
+
await generatedAnswer.typeInFeedbackDetailsInput(
|
|
88
|
+
exampleDetails
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
const feedbackRequestPromise =
|
|
92
|
+
generatedAnswer.waitForFeedbackSubmitRequest({
|
|
93
|
+
correctTopic: 'yes',
|
|
94
|
+
hallucinationFree: 'yes',
|
|
95
|
+
documented: 'unknown',
|
|
96
|
+
readable: 'yes',
|
|
97
|
+
documentUrl: exampleDocumentUrl,
|
|
98
|
+
details: exampleDetails,
|
|
99
|
+
helpful: true,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
await generatedAnswer.clickSubmitFeedbackButton();
|
|
103
|
+
await feedbackRequestPromise;
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test('should keep sending RGA analytics events after submitting feedback', async ({
|
|
107
|
+
generatedAnswer,
|
|
108
|
+
}) => {
|
|
109
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
110
|
+
const likeAnalyticRequestPromise =
|
|
111
|
+
generatedAnswer.waitForLikeGeneratedAnswerAnalytics();
|
|
112
|
+
await generatedAnswer.clickLikeButton();
|
|
113
|
+
await likeAnalyticRequestPromise;
|
|
114
|
+
|
|
115
|
+
const exampleDocumentUrl = 'https://www.coveo.com/';
|
|
116
|
+
const exampleDetails = 'example details...';
|
|
117
|
+
await generatedAnswer.fillFeedbackForm({
|
|
118
|
+
correctTopic: 'Yes',
|
|
119
|
+
hallucinationFree: 'Yes',
|
|
120
|
+
documented: 'Not sure',
|
|
121
|
+
readable: 'Yes',
|
|
122
|
+
});
|
|
123
|
+
await generatedAnswer.typeInFeedbackDocumentUrlInput(
|
|
124
|
+
exampleDocumentUrl
|
|
125
|
+
);
|
|
126
|
+
await generatedAnswer.typeInFeedbackDetailsInput(
|
|
127
|
+
exampleDetails
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const feedbackRequestPromise =
|
|
131
|
+
generatedAnswer.waitForFeedbackSubmitRequest({
|
|
132
|
+
correctTopic: 'yes',
|
|
133
|
+
hallucinationFree: 'yes',
|
|
134
|
+
documented: 'unknown',
|
|
135
|
+
readable: 'yes',
|
|
136
|
+
documentUrl: exampleDocumentUrl,
|
|
137
|
+
details: exampleDetails,
|
|
138
|
+
helpful: true,
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
await generatedAnswer.clickSubmitFeedbackButton();
|
|
142
|
+
await feedbackRequestPromise;
|
|
143
|
+
|
|
144
|
+
await generatedAnswer.clickCompleteFeedbackButton();
|
|
145
|
+
|
|
146
|
+
// Click the copy to clipboard button and ensure the analytic is sent.
|
|
147
|
+
const copyToClipboardAnalyticRequestPromise =
|
|
148
|
+
generatedAnswer.waitForCopyToClipboardAnalytics();
|
|
149
|
+
await generatedAnswer.clickCopyToClipboardButton();
|
|
150
|
+
await copyToClipboardAnalyticRequestPromise;
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
test.describe('when providing negative feedback', () => {
|
|
155
|
+
test('should send negative feedback analytics containing all details', async ({
|
|
156
|
+
generatedAnswer,
|
|
157
|
+
}) => {
|
|
158
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
159
|
+
const dislikeAnalyticRequestPromise =
|
|
160
|
+
generatedAnswer.waitForDislikeGeneratedAnswerAnalytics();
|
|
161
|
+
await generatedAnswer.clickDislikeButton();
|
|
162
|
+
await dislikeAnalyticRequestPromise;
|
|
163
|
+
|
|
164
|
+
const exampleDocumentUrl = 'https://www.coveo.com/';
|
|
165
|
+
const exampleDetails = 'example details...';
|
|
166
|
+
await generatedAnswer.fillFeedbackForm({
|
|
167
|
+
correctTopic: 'No',
|
|
168
|
+
hallucinationFree: 'Not sure',
|
|
169
|
+
documented: 'No',
|
|
170
|
+
readable: 'No',
|
|
171
|
+
});
|
|
172
|
+
await generatedAnswer.typeInFeedbackDocumentUrlInput(
|
|
173
|
+
exampleDocumentUrl
|
|
174
|
+
);
|
|
175
|
+
await generatedAnswer.typeInFeedbackDetailsInput(
|
|
176
|
+
exampleDetails
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
const feedbackRequestPromise =
|
|
180
|
+
generatedAnswer.waitForFeedbackSubmitRequest({
|
|
181
|
+
correctTopic: 'no',
|
|
182
|
+
hallucinationFree: 'unknown',
|
|
183
|
+
documented: 'no',
|
|
184
|
+
readable: 'no',
|
|
185
|
+
documentUrl: exampleDocumentUrl,
|
|
186
|
+
details: exampleDetails,
|
|
187
|
+
helpful: false,
|
|
188
|
+
});
|
|
189
|
+
await generatedAnswer.clickSubmitFeedbackButton();
|
|
190
|
+
await feedbackRequestPromise;
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
test.describe('when copying the generated answer to clipboard', () => {
|
|
195
|
+
test('should send a copy to clipboard analytics event', async ({
|
|
196
|
+
generatedAnswer,
|
|
197
|
+
}) => {
|
|
198
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
199
|
+
const analyticRequestPromise =
|
|
200
|
+
generatedAnswer.waitForCopyToClipboardAnalytics();
|
|
201
|
+
await generatedAnswer.clickCopyToClipboardButton();
|
|
202
|
+
await analyticRequestPromise;
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
test.describe('when the property withToggle is set to true', () => {
|
|
207
|
+
test.use({
|
|
208
|
+
options: {
|
|
209
|
+
...config.options,
|
|
210
|
+
withToggle: true,
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
test('should allow toggling the generated OFF and ON and log analytics', async ({
|
|
215
|
+
generatedAnswer,
|
|
216
|
+
}) => {
|
|
217
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
218
|
+
const hideAnswerAnalyticRequestPromise =
|
|
219
|
+
generatedAnswer.waitForHideAnswersAnalytics();
|
|
220
|
+
await generatedAnswer.clickToggleButton();
|
|
221
|
+
await hideAnswerAnalyticRequestPromise;
|
|
222
|
+
|
|
223
|
+
const showAnswerAnalyticRequestPromise =
|
|
224
|
+
generatedAnswer.waitForShowAnswersAnalytics();
|
|
225
|
+
await generatedAnswer.clickToggleButton();
|
|
226
|
+
await showAnswerAnalyticRequestPromise;
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
test.describe('when interacting with citations', () => {
|
|
231
|
+
test.describe('when hovering over a citation', () => {
|
|
232
|
+
test('should log citation hover analytics', async ({
|
|
233
|
+
generatedAnswer,
|
|
234
|
+
}) => {
|
|
235
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
236
|
+
const citationIndex = 0;
|
|
237
|
+
const {id, permanentid} = genQaData.citations[citationIndex];
|
|
238
|
+
const citationHoverAnalyticRequestPromise =
|
|
239
|
+
generatedAnswer.waitForSourceHoverAnalytics({
|
|
240
|
+
citationId: id,
|
|
241
|
+
permanentId: permanentid,
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
await generatedAnswer.hoverOverCitation(citationIndex);
|
|
245
|
+
await citationHoverAnalyticRequestPromise;
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
test.describe('when clicking on a citation', () => {
|
|
250
|
+
test('should log citation click analytics', async ({
|
|
251
|
+
generatedAnswer,
|
|
252
|
+
}) => {
|
|
253
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
254
|
+
const citationIndex = 0;
|
|
255
|
+
const {id, title, source, uri, clickUri, permanentid} =
|
|
256
|
+
genQaData.citations[citationIndex];
|
|
257
|
+
const citationClickAnalyticRequestPromise =
|
|
258
|
+
generatedAnswer.waitForCitationClickAnalytics({
|
|
259
|
+
documentTitle: title,
|
|
260
|
+
sourceName: source,
|
|
261
|
+
documentPosition: citationIndex + 1,
|
|
262
|
+
documentUri: uri,
|
|
263
|
+
documentUrl: clickUri,
|
|
264
|
+
citationId: id,
|
|
265
|
+
contentIDKey: 'permanentid',
|
|
266
|
+
contentIDValue: permanentid,
|
|
267
|
+
});
|
|
268
|
+
await generatedAnswer.clickOnCitation(citationIndex);
|
|
269
|
+
await citationClickAnalyticRequestPromise;
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
test.describe('when the answer is generated in a single shot and the answer exceeds the maximum height', () => {
|
|
275
|
+
test.use({
|
|
276
|
+
options: {
|
|
277
|
+
...config.options,
|
|
278
|
+
collapsible: true,
|
|
279
|
+
},
|
|
280
|
+
});
|
|
281
|
+
test('should display the answer as collapsed', async ({
|
|
282
|
+
generatedAnswer,
|
|
283
|
+
}) => {
|
|
284
|
+
const expectedShowMoreLabel = 'Show more';
|
|
285
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
286
|
+
|
|
287
|
+
const showMoreButton = generatedAnswer.showMoreButton;
|
|
288
|
+
expect(showMoreButton).not.toBeNull();
|
|
289
|
+
|
|
290
|
+
const showMoreButtonLabel = await showMoreButton.textContent();
|
|
291
|
+
expect(showMoreButtonLabel).not.toBeNull();
|
|
292
|
+
expect(showMoreButtonLabel).toEqual(expectedShowMoreLabel);
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
if (config.options.answerConfigurationId) {
|
|
297
|
+
test.describe('when selecting a timeframe facet after the answer is generated', () => {
|
|
298
|
+
test.use({
|
|
299
|
+
options: {
|
|
300
|
+
...config.options,
|
|
301
|
+
},
|
|
302
|
+
withFacets: true,
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
test('should trigger a new generate call to the answer API', async ({
|
|
306
|
+
generatedAnswer,
|
|
307
|
+
baseFacet,
|
|
308
|
+
}) => {
|
|
309
|
+
await generatedAnswer.streamEndAnalyticRequestPromise;
|
|
310
|
+
|
|
311
|
+
const generateRequestPromise =
|
|
312
|
+
generatedAnswer.waitForGenerateRequest();
|
|
313
|
+
|
|
314
|
+
const streamEndAnalyticRequestPromise =
|
|
315
|
+
generatedAnswer.waitForStreamEndAnalytics();
|
|
316
|
+
|
|
317
|
+
const searchResponsePromise =
|
|
318
|
+
baseFacet.waitForSearchResponse();
|
|
319
|
+
|
|
320
|
+
await generatedAnswer.clickFirstTimeframeFacetLink();
|
|
321
|
+
|
|
322
|
+
const generateRequest = await generateRequestPromise;
|
|
323
|
+
const generateRequestBody = generateRequest.postDataJSON();
|
|
324
|
+
expect(generateRequestBody.analytics.actionCause).toBe(
|
|
325
|
+
'facetSelect'
|
|
326
|
+
);
|
|
327
|
+
await streamEndAnalyticRequestPromise;
|
|
328
|
+
await searchResponsePromise;
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
});
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import QuanticGeneratedAnswerContent from 'c/quanticGeneratedAnswerContent';
|
|
3
|
+
import {createElement} from 'lwc';
|
|
4
|
+
import {loadMarkdownDependencies} from 'c/quanticUtils';
|
|
5
|
+
|
|
6
|
+
jest.mock('c/quanticUtils', () => ({
|
|
7
|
+
loadMarkdownDependencies: jest.fn(
|
|
8
|
+
() =>
|
|
9
|
+
new Promise((resolve) => {
|
|
10
|
+
resolve();
|
|
11
|
+
})
|
|
12
|
+
),
|
|
13
|
+
transformMarkdownToHtml: jest.fn((value) => value),
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
const mockMarkedUse = jest.fn();
|
|
17
|
+
const mockMarkedParse = jest.fn((text) => text);
|
|
18
|
+
global.marked = {
|
|
19
|
+
use: mockMarkedUse,
|
|
20
|
+
parse: mockMarkedParse,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const SELECTORS = {
|
|
24
|
+
textAnswerContainer: 'span.generated-answer-content__answer',
|
|
25
|
+
markdownAnswerContainer: 'div.generated-answer-content__answer',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const defaultOptions = {
|
|
29
|
+
isStreaming: false,
|
|
30
|
+
answerContentFormat: 'text/plain',
|
|
31
|
+
answer: '',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
function createTestComponent(options = defaultOptions) {
|
|
35
|
+
const element = createElement('c-quantic-generated-answer-content', {
|
|
36
|
+
is: QuanticGeneratedAnswerContent,
|
|
37
|
+
});
|
|
38
|
+
for (const [key, value] of Object.entries(options)) {
|
|
39
|
+
element[key] = value;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
document.body.appendChild(element);
|
|
43
|
+
return element;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Helper function to wait until the microtask queue is empty.
|
|
47
|
+
function flushPromises() {
|
|
48
|
+
// eslint-disable-next-line @lwc/lwc/no-async-operation
|
|
49
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
describe('c-quantic-generated-answer-content', () => {
|
|
53
|
+
function cleanup() {
|
|
54
|
+
// The jsdom instance is shared across test cases in a single file so reset the DOM
|
|
55
|
+
while (document.body.firstChild) {
|
|
56
|
+
document.body.removeChild(document.body.firstChild);
|
|
57
|
+
}
|
|
58
|
+
jest.clearAllMocks();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
afterEach(() => {
|
|
62
|
+
cleanup();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
describe('text/plain answer content', () => {
|
|
66
|
+
it('should render a simple text/plain answer when not streaming', async () => {
|
|
67
|
+
const element = createTestComponent({
|
|
68
|
+
...defaultOptions,
|
|
69
|
+
answer: 'Hello, world!',
|
|
70
|
+
});
|
|
71
|
+
await flushPromises();
|
|
72
|
+
|
|
73
|
+
const answerContent = element.shadowRoot.querySelector(
|
|
74
|
+
SELECTORS.textAnswerContainer
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
expect(answerContent.textContent).toBe('Hello, world!');
|
|
78
|
+
expect(answerContent.className).toBe('generated-answer-content__answer');
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('should render a text/plain answer when streaming', async () => {
|
|
82
|
+
const element = createTestComponent({
|
|
83
|
+
...defaultOptions,
|
|
84
|
+
answer: 'Hello, world!',
|
|
85
|
+
isStreaming: true,
|
|
86
|
+
});
|
|
87
|
+
await flushPromises();
|
|
88
|
+
|
|
89
|
+
const answerContent = element.shadowRoot.querySelector(
|
|
90
|
+
SELECTORS.textAnswerContainer
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
expect(answerContent.textContent).toBe('Hello, world!');
|
|
94
|
+
expect(answerContent.className).toContain(
|
|
95
|
+
'generated-answer-content__answer--streaming'
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe('text/markdown answer content', () => {
|
|
101
|
+
it('should render a simple markdown answer when not streaming', async () => {
|
|
102
|
+
const element = createTestComponent({
|
|
103
|
+
...defaultOptions,
|
|
104
|
+
answerContentFormat: 'text/markdown',
|
|
105
|
+
answer: 'Hello, world!',
|
|
106
|
+
});
|
|
107
|
+
await flushPromises();
|
|
108
|
+
|
|
109
|
+
const answerContent = element.shadowRoot.querySelector(
|
|
110
|
+
SELECTORS.markdownAnswerContainer
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
expect(answerContent.textContent).toBe('Hello, world!');
|
|
114
|
+
expect(answerContent.className).toBe('generated-answer-content__answer');
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('should render a simple markdown answer when streaming', async () => {
|
|
118
|
+
const element = createTestComponent({
|
|
119
|
+
...defaultOptions,
|
|
120
|
+
answerContentFormat: 'text/markdown',
|
|
121
|
+
answer: 'Hello, world!',
|
|
122
|
+
isStreaming: true,
|
|
123
|
+
});
|
|
124
|
+
await flushPromises();
|
|
125
|
+
|
|
126
|
+
const answerContent = element.shadowRoot.querySelector(
|
|
127
|
+
SELECTORS.markdownAnswerContainer
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
expect(answerContent.textContent).toBe('Hello, world!');
|
|
131
|
+
expect(answerContent.className).toContain(
|
|
132
|
+
'generated-answer-content__answer--streaming'
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe('the reactivity of the answerContentFormat property', () => {
|
|
138
|
+
it('should load the markdown dependencies when the answerContentFormat property is changed to text/markdown', async () => {
|
|
139
|
+
const element = createTestComponent({
|
|
140
|
+
...defaultOptions,
|
|
141
|
+
answerContentFormat: 'text/plain',
|
|
142
|
+
});
|
|
143
|
+
await flushPromises();
|
|
144
|
+
expect(loadMarkdownDependencies).not.toHaveBeenCalled();
|
|
145
|
+
|
|
146
|
+
element.answerContentFormat = 'text/markdown';
|
|
147
|
+
await flushPromises();
|
|
148
|
+
expect(loadMarkdownDependencies).toHaveBeenCalled();
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import {createElement} from 'lwc';
|
|
3
|
+
import QuanticHeading from '../quanticHeading';
|
|
4
|
+
|
|
5
|
+
const exampleLabel = 'Example Label';
|
|
6
|
+
const exampleLevel = 3;
|
|
7
|
+
const selectors = {
|
|
8
|
+
label: '[data-section="label"]',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const defaultOptions = {
|
|
12
|
+
label: exampleLabel,
|
|
13
|
+
level: exampleLevel,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function createTestComponent(options = defaultOptions) {
|
|
17
|
+
const element = createElement('c-quantic-heading', {
|
|
18
|
+
is: QuanticHeading,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
for (const [key, value] of Object.entries(options)) {
|
|
22
|
+
element[key] = value;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
document.body.appendChild(element);
|
|
26
|
+
return element;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Helper function to wait until the microtask queue is empty.
|
|
30
|
+
function flushPromises() {
|
|
31
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
describe('c-quantic-heading', () => {
|
|
35
|
+
function cleanup() {
|
|
36
|
+
// The jsdom instance is shared across test cases in a single file so reset the DOM
|
|
37
|
+
while (document.body.firstChild) {
|
|
38
|
+
document.body.removeChild(document.body.firstChild);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
afterEach(() => {
|
|
43
|
+
cleanup();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should display the label with the right header tag level', async () => {
|
|
47
|
+
const expectedTag = `h${exampleLevel}`;
|
|
48
|
+
const element = createTestComponent();
|
|
49
|
+
await flushPromises();
|
|
50
|
+
|
|
51
|
+
const label = element.shadowRoot.querySelector(
|
|
52
|
+
`${selectors.label} > ${expectedTag}`
|
|
53
|
+
);
|
|
54
|
+
expect(label).not.toBeNull();
|
|
55
|
+
expect(label.innerText).toBe(exampleLabel);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('when an invalid value of the level property is used', () => {
|
|
59
|
+
it('should display the label in a "div" tag', async () => {
|
|
60
|
+
const expectedTag = 'div';
|
|
61
|
+
const element = createTestComponent({...defaultOptions, level: 7});
|
|
62
|
+
await flushPromises();
|
|
63
|
+
|
|
64
|
+
const label = element.shadowRoot.querySelector(
|
|
65
|
+
`${selectors.label} > ${expectedTag}`
|
|
66
|
+
);
|
|
67
|
+
expect(label).not.toBeNull();
|
|
68
|
+
expect(label.innerText).toBe(exampleLabel);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|