@coveo/quantic 3.44.1 → 3.44.2

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.
Files changed (203) hide show
  1. package/force-app/main/default/classes/OrganizationEndpointsTest.cls +71 -15
  2. package/force-app/main/default/classes/RecommendationsControllerTest.cls +1 -1
  3. package/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js +148 -125
  4. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +16 -16
  5. package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
  6. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
  7. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +16 -16
  8. package/package.json +33 -31
  9. package/force-app/main/default/lwc/quanticAriaLive/__tests__/quanticAriaLive.test.js +0 -106
  10. package/force-app/main/default/lwc/quanticBreadcrumbManager/__tests__/quanticBreadcrumbManager.test.js +0 -752
  11. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/data.ts +0 -130
  12. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +0 -87
  13. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/pageObject.ts +0 -282
  14. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +0 -208
  15. package/force-app/main/default/lwc/quanticCarousel/__tests__/quanticCarousel.test.js +0 -262
  16. package/force-app/main/default/lwc/quanticCaseClassification/__tests__/quanticCaseClassification.test.js +0 -819
  17. package/force-app/main/default/lwc/quanticCaseClassification/e2e/data.ts +0 -23
  18. package/force-app/main/default/lwc/quanticCaseClassification/e2e/fixture.ts +0 -51
  19. package/force-app/main/default/lwc/quanticCaseClassification/e2e/pageObject.ts +0 -152
  20. package/force-app/main/default/lwc/quanticCaseClassification/e2e/quanticCaseClassification.e2e.ts +0 -269
  21. package/force-app/main/default/lwc/quanticCategoryFacet/__tests__/quanticCategoryFacet.test.js +0 -1183
  22. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +0 -91
  23. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +0 -79
  24. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/pageObject.ts +0 -55
  25. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +0 -219
  26. package/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js +0 -581
  27. package/force-app/main/default/lwc/quanticColoredResultBadge/__tests__/quanticColoredResultBadge.test.js +0 -212
  28. package/force-app/main/default/lwc/quanticDateFacet/__tests__/quanticDateFacet.test.js +0 -688
  29. package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +0 -44
  30. package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +0 -72
  31. package/force-app/main/default/lwc/quanticDateFacet/e2e/pageObject.ts +0 -27
  32. package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +0 -167
  33. package/force-app/main/default/lwc/quanticDidYouMean/__tests__/quanticDidYouMean.test.js +0 -348
  34. package/force-app/main/default/lwc/quanticDidYouMean/e2e/data.ts +0 -48
  35. package/force-app/main/default/lwc/quanticDidYouMean/e2e/fixture.ts +0 -84
  36. package/force-app/main/default/lwc/quanticDidYouMean/e2e/pageObject.ts +0 -173
  37. package/force-app/main/default/lwc/quanticDidYouMean/e2e/quanticDidYouMean.e2e.ts +0 -219
  38. package/force-app/main/default/lwc/quanticDocumentSuggestion/__tests__/quanticDocumentSuggestion.test.js +0 -404
  39. package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/fixture.ts +0 -38
  40. package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/pageObject.ts +0 -52
  41. package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/quanticDocumentSuggestion.e2e.ts +0 -102
  42. package/force-app/main/default/lwc/quanticFacet/__tests__/quanticFacet.test.js +0 -1105
  43. package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +0 -62
  44. package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +0 -78
  45. package/force-app/main/default/lwc/quanticFacet/e2e/pageObject.ts +0 -67
  46. package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +0 -242
  47. package/force-app/main/default/lwc/quanticFacetCaption/__tests__/quanticFacetCaption.test.js +0 -28
  48. package/force-app/main/default/lwc/quanticFacetManager/__tests__/quanticFacetManager.test.js +0 -178
  49. package/force-app/main/default/lwc/quanticFacetManager/e2e/data.ts +0 -59
  50. package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +0 -75
  51. package/force-app/main/default/lwc/quanticFacetManager/e2e/pageObject.ts +0 -23
  52. package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +0 -82
  53. package/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js +0 -403
  54. package/force-app/main/default/lwc/quanticFeedbackModal/__tests__/quanticFeedbackModal.test.js +0 -448
  55. package/force-app/main/default/lwc/quanticFeedbackModalQna/__tests__/quanticFeedbackModalQna.test.js +0 -298
  56. package/force-app/main/default/lwc/quanticFoldedResultList/__tests__/quanticFoldedResultList.test.js +0 -323
  57. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/fixture.ts +0 -74
  58. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/pageObject.ts +0 -81
  59. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/quanticFoldedResultList.e2e.ts +0 -69
  60. package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +0 -1575
  61. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/agentData.ts +0 -279
  62. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/data.ts +0 -56
  63. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture-agent.ts +0 -77
  64. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture.ts +0 -194
  65. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +0 -599
  66. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswer.e2e.ts +0 -333
  67. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswerAgent.e2e.ts +0 -298
  68. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/__tests__/quanticGeneratedAnswerBody.test.js +0 -418
  69. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/__tests__/quanticGeneratedAnswerContent.test.js +0 -447
  70. package/force-app/main/default/lwc/quanticGeneratedAnswerCopyToClipboard/__tests__/quanticGeneratedAnswerCopyToClipboard.test.js +0 -129
  71. package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/__tests__/quanticGeneratedAnswerFollowUpInput.test.js +0 -466
  72. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/quanticGeneratedAnswerStreamOfThought.test.js +0 -402
  73. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/stepsUtils.test.js +0 -118
  74. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/__tests__/quanticGeneratedAnswerThread.test.js +0 -285
  75. package/force-app/main/default/lwc/quanticHeading/__tests__/quanticHeading.test.js +0 -71
  76. package/force-app/main/default/lwc/quanticHeadlessLoader/__tests__/quanticHeadlessLoader.test.js +0 -651
  77. package/force-app/main/default/lwc/quanticInsightInterface/__tests__/quanticInsightInterface.test.js +0 -194
  78. package/force-app/main/default/lwc/quanticInsightSummary/__tests__/quanticInsightSummary.test.js +0 -230
  79. package/force-app/main/default/lwc/quanticModal/__tests__/quanticModal.test.js +0 -205
  80. package/force-app/main/default/lwc/quanticNotifications/__tests__/quanticNotifications.test.js +0 -309
  81. package/force-app/main/default/lwc/quanticNotifications/e2e/fixture.ts +0 -62
  82. package/force-app/main/default/lwc/quanticNotifications/e2e/pageObject.ts +0 -55
  83. package/force-app/main/default/lwc/quanticNotifications/e2e/quanticNotifications.e2e.ts +0 -47
  84. package/force-app/main/default/lwc/quanticNumericFacet/__tests__/quanticNumericFacet.test.js +0 -953
  85. package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +0 -48
  86. package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +0 -75
  87. package/force-app/main/default/lwc/quanticNumericFacet/e2e/pageObject.ts +0 -59
  88. package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +0 -186
  89. package/force-app/main/default/lwc/quanticPager/__tests__/quanticPager.test.js +0 -430
  90. package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +0 -65
  91. package/force-app/main/default/lwc/quanticPager/e2e/pageObject.ts +0 -69
  92. package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +0 -106
  93. package/force-app/main/default/lwc/quanticPlaceholder/__tests__/quanticPlaceholder.test.js +0 -47
  94. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/defaultTestCase.json +0 -13
  95. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/youtubeTestCase.json +0 -14
  96. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js +0 -82
  97. package/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js +0 -273
  98. package/force-app/main/default/lwc/quanticRecentQueriesList/__tests__/quanticRecentQueriesList.test.js +0 -448
  99. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/fixture.ts +0 -43
  100. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/pageObject.ts +0 -55
  101. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/quanticRecentQueriesList.e2e.ts +0 -93
  102. package/force-app/main/default/lwc/quanticRecentResultsList/__tests__/quanticRecentResultsList.test.js +0 -516
  103. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/fixture.ts +0 -43
  104. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/pageObject.ts +0 -61
  105. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/quanticRecentResultsList.e2e.ts +0 -48
  106. package/force-app/main/default/lwc/quanticRecommendationList/__tests__/quanticRecommendationList.test.js +0 -491
  107. package/force-app/main/default/lwc/quanticRecommendationList/e2e/fixture.ts +0 -36
  108. package/force-app/main/default/lwc/quanticRecommendationList/e2e/pageObject.ts +0 -52
  109. package/force-app/main/default/lwc/quanticRecommendationList/e2e/quanticRecommendationList.e2e.ts +0 -53
  110. package/force-app/main/default/lwc/quanticRefineModalContent/__tests__/quanticRefineModalContent.test.js +0 -747
  111. package/force-app/main/default/lwc/quanticRefineToggle/__tests__/quanticRefineToggle.test.js +0 -544
  112. package/force-app/main/default/lwc/quanticResultAction/__tests__/quanticResultAction.test.js +0 -262
  113. package/force-app/main/default/lwc/quanticResultActionBar/__tests__/quanticResultActionBar.test.js +0 -141
  114. package/force-app/main/default/lwc/quanticResultChildren/__tests__/quanticResultChildren.test.js +0 -340
  115. package/force-app/main/default/lwc/quanticResultCopyToClipboard/__tests__/quanticResultCopyToClipboard.test.js +0 -300
  116. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/fixture.ts +0 -49
  117. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/pageObject.ts +0 -49
  118. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/quanticResultCopyToClipboard.e2e.ts +0 -40
  119. package/force-app/main/default/lwc/quanticResultDate/__tests__/quanticResultDate.test.js +0 -144
  120. package/force-app/main/default/lwc/quanticResultField/__tests__/quanticResultField.test.js +0 -120
  121. package/force-app/main/default/lwc/quanticResultHighlightedTextField/__tests__/quanticResultHighlightedTextField.test.js +0 -209
  122. package/force-app/main/default/lwc/quanticResultLink/__tests__/quanticResultLink.test.js +0 -302
  123. package/force-app/main/default/lwc/quanticResultList/__tests__/quanticResultList.test.js +0 -342
  124. package/force-app/main/default/lwc/quanticResultList/e2e/fixture.ts +0 -70
  125. package/force-app/main/default/lwc/quanticResultList/e2e/pageObject.ts +0 -81
  126. package/force-app/main/default/lwc/quanticResultList/e2e/quanticResultList.e2e.ts +0 -69
  127. package/force-app/main/default/lwc/quanticResultMultiValueText/__tests__/quanticResultMultiValueText.test.js +0 -235
  128. package/force-app/main/default/lwc/quanticResultNumber/__tests__/quanticResultNumber.test.js +0 -144
  129. package/force-app/main/default/lwc/quanticResultPrintableUri/__tests__/quanticResultPrintableUri.test.js +0 -324
  130. package/force-app/main/default/lwc/quanticResultQuickview/__tests__/quanticResultQuickview.test.js +0 -308
  131. package/force-app/main/default/lwc/quanticResultQuickview/e2e/fixture.ts +0 -85
  132. package/force-app/main/default/lwc/quanticResultQuickview/e2e/pageObject.ts +0 -38
  133. package/force-app/main/default/lwc/quanticResultQuickview/e2e/quanticResultQuickView.e2e.ts +0 -66
  134. package/force-app/main/default/lwc/quanticResultTemplate/__tests__/quanticResultTemplate.test.js +0 -90
  135. package/force-app/main/default/lwc/quanticResultText/__tests__/quanticResultText.test.js +0 -155
  136. package/force-app/main/default/lwc/quanticResultsPerPage/__tests__/quanticResultsPerPage.test.js +0 -464
  137. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/fixture.ts +0 -78
  138. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/pageObject.ts +0 -85
  139. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/quanticResultsPerPage.e2e.ts +0 -97
  140. package/force-app/main/default/lwc/quanticSearchBox/__tests__/quanticSearchBox.test.js +0 -487
  141. package/force-app/main/default/lwc/quanticSearchBox/e2e/fixture.ts +0 -86
  142. package/force-app/main/default/lwc/quanticSearchBox/e2e/pageObject.ts +0 -45
  143. package/force-app/main/default/lwc/quanticSearchBox/e2e/quanticSearchBox.e2e.ts +0 -159
  144. package/force-app/main/default/lwc/quanticSearchBoxInput/__tests__/quanticSearchBoxInput.test.js +0 -743
  145. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/__tests__/quanticSearchBoxSuggestionsList.test.js +0 -571
  146. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/fixture.ts +0 -113
  147. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/pageObject.ts +0 -113
  148. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/quanticSearchBoxSuggestionsList.e2e.ts +0 -282
  149. package/force-app/main/default/lwc/quanticSmartSnippet/__tests__/quanticSmartSnippet.test.js +0 -341
  150. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/data.ts +0 -21
  151. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/fixture.ts +0 -93
  152. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/pageObject.ts +0 -196
  153. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts +0 -168
  154. package/force-app/main/default/lwc/quanticSmartSnippetAnswer/__tests__/quanticSmartSnippetAnswer.test.js +0 -126
  155. package/force-app/main/default/lwc/quanticSmartSnippetSource/__tests__/quanticSmartSnippetSource.test.js +0 -290
  156. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/__tests__/quanticSmartSnippetSuggestions.test.js +0 -329
  157. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/data.ts +0 -31
  158. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/fixture.ts +0 -95
  159. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/pageObject.ts +0 -160
  160. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/quanticSmartSnippetSuggestions.e2e.ts +0 -127
  161. package/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js +0 -416
  162. package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +0 -62
  163. package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +0 -100
  164. package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +0 -86
  165. package/force-app/main/default/lwc/quanticSourceCitations/__tests__/quanticSourceCitations.test.js +0 -156
  166. package/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js +0 -387
  167. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/fixture.ts +0 -54
  168. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/pageObject.ts +0 -54
  169. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/quanticStandaloneSearchBox.e2e.ts +0 -72
  170. package/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js +0 -222
  171. package/force-app/main/default/lwc/quanticSummary/__tests__/quanticSummary.test.js +0 -244
  172. package/force-app/main/default/lwc/quanticTab/__tests__/quanticTab.test.js +0 -333
  173. package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +0 -60
  174. package/force-app/main/default/lwc/quanticTab/e2e/pageObject.ts +0 -68
  175. package/force-app/main/default/lwc/quanticTab/e2e/quanticTab.e2e.ts +0 -72
  176. package/force-app/main/default/lwc/quanticTabBar/__tests__/quanticTabBar.test.js +0 -331
  177. package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +0 -65
  178. package/force-app/main/default/lwc/quanticTabBar/e2e/pageObject.ts +0 -80
  179. package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +0 -172
  180. package/force-app/main/default/lwc/quanticThreadItem/__tests__/quanticThreadItem.test.js +0 -314
  181. package/force-app/main/default/lwc/quanticTimeframeFacet/__tests__/quanticTimeframeFacet.test.js +0 -1059
  182. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/data.ts +0 -66
  183. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +0 -74
  184. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/pageObject.ts +0 -43
  185. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +0 -184
  186. package/force-app/main/default/lwc/quanticTooltip/__tests__/quanticTooltip.test.js +0 -107
  187. package/force-app/main/default/lwc/quanticUserAction/__tests__/quanticUserAction.test.js +0 -427
  188. package/force-app/main/default/lwc/quanticUserActionsSession/__tests__/quanticUserActionsSession.test.js +0 -269
  189. package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/data/userActionsState.json +0 -89
  190. package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/quanticUserActionsTimeline.test.js +0 -511
  191. package/force-app/main/default/lwc/quanticUserActionsToggle/__tests__/quanticUserActionsToggle.test.js +0 -229
  192. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/data.ts +0 -32
  193. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/fixture.ts +0 -32
  194. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/pageObject.ts +0 -71
  195. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/quanticUserActionsToggle.e2e.ts +0 -39
  196. package/force-app/main/default/lwc/quanticUtils/__tests__/accessibilityUtils.test.js +0 -214
  197. package/force-app/main/default/lwc/quanticUtils/__tests__/citationAnchoringUtils.test.js +0 -84
  198. package/force-app/main/default/lwc/quanticUtils/__tests__/facetDependenciesUtils.test.js +0 -92
  199. package/force-app/main/default/lwc/quanticUtils/__tests__/facetStoreUtils.test.js +0 -86
  200. package/force-app/main/default/lwc/quanticUtils/__tests__/markdownUtils.test.js +0 -109
  201. package/force-app/main/default/lwc/quanticUtils/__tests__/quanticUtils.test.js +0 -233
  202. package/force-app/main/default/lwc/quanticUtils/__tests__/timeAndDateUtils.test.js +0 -22
  203. package/force-app/main/default/lwc/quanticViewedByCustomerBadge/__tests__/quanticViewedByCustomerBadge.test.js +0 -131
@@ -1,62 +0,0 @@
1
- const facetId = 'objecttype';
2
- const field = 'objecttype';
3
- const label = 'Object type';
4
-
5
- /**
6
- * Facet response before any value is selected.
7
- */
8
- export const initialFacetData = {
9
- facetId,
10
- field,
11
- moreValuesAvailable: true,
12
- values: [
13
- {
14
- value: 'People',
15
- state: 'idle',
16
- numberOfResults: 126959,
17
- },
18
- {
19
- value: 'Contact',
20
- state: 'idle',
21
- numberOfResults: 179426,
22
- },
23
- ],
24
- indexScore: 0.40500903971252294,
25
- label,
26
- };
27
-
28
- const [people, contact] = initialFacetData.values;
29
-
30
- /**
31
- * Facet response after clicking "Show more".
32
- */
33
- export const expandedFacetData = {
34
- ...initialFacetData,
35
- values: [
36
- ...initialFacetData.values,
37
- {
38
- value: 'Variant',
39
- state: 'idle',
40
- numberOfResults: 30827,
41
- },
42
- {
43
- value: 'Message',
44
- state: 'idle',
45
- numberOfResults: 26879,
46
- },
47
- ],
48
- };
49
-
50
- /**
51
- * Facet response after the first value is selected.
52
- */
53
- export const selectedFacetData = {
54
- ...initialFacetData,
55
- values: [
56
- {
57
- ...people,
58
- state: 'selected',
59
- },
60
- contact,
61
- ],
62
- };
@@ -1,78 +0,0 @@
1
- import {FacetObject} from './pageObject';
2
- import {useCaseEnum} from '../../../../../../playwright/utils/useCase';
3
- import {InsightSetupObject} from '../../../../../../playwright/page-object/insightSetupObject';
4
- import {
5
- searchRequestRegex,
6
- insightSearchRequestRegex,
7
- } from '../../../../../../playwright/utils/requests';
8
- import {BaseFacetObject} from '../../../../../../playwright/page-object/baseFacetObject';
9
- import {initialFacetData} from './data';
10
- import {facetBase} from '../../../../../../playwright/fixtures/baseFacetFixture';
11
-
12
- const pageUrl = 's/quantic-facet';
13
-
14
- interface FacetOptions {
15
- value?: string;
16
- caption?: string;
17
- numberOfValues?: number;
18
- }
19
-
20
- type QuanticFacetE2EFixtures = {
21
- facet: FacetObject;
22
- options: Partial<FacetOptions>;
23
- insightSetup?: InsightSetupObject;
24
- };
25
-
26
- export const testSearch = facetBase.extend<QuanticFacetE2EFixtures>({
27
- options: {},
28
- facetResponses: {responses: [[initialFacetData]]},
29
- baseFacet: async ({page}, use) => {
30
- await use(new BaseFacetObject(page, searchRequestRegex));
31
- },
32
- facet: async (
33
- {page, options, configuration, baseFacet, urlHash, facetResponses},
34
- use
35
- ) => {
36
- // search use case: interface auto-triggers a search on load, hence the mockSearchWithBaseResponse call below
37
- await baseFacet.mockSearchWithBaseResponse();
38
- await page.goto(
39
- `${pageUrl}${options.caption ? '-with-captions' : ''}#${urlHash ? urlHash : ''}`
40
- );
41
- await baseFacet.mockSearchWithFacetResponseSequence(
42
- facetResponses?.responses
43
- );
44
- configuration.configure(options);
45
- await baseFacet.waitForSearchResponse();
46
-
47
- await use(new FacetObject(page));
48
- },
49
- });
50
-
51
- export const testInsight = facetBase.extend<QuanticFacetE2EFixtures>({
52
- options: {},
53
- facetResponses: {responses: [[initialFacetData]]},
54
- baseFacet: async ({page}, use) => {
55
- await use(new BaseFacetObject(page, insightSearchRequestRegex));
56
- },
57
- insightSetup: async ({page}, use) => {
58
- await use(new InsightSetupObject(page));
59
- },
60
- facet: async (
61
- {page, options, baseFacet, configuration, insightSetup, facetResponses},
62
- use
63
- ) => {
64
- await page.goto(`${pageUrl}${options.caption ? '-with-captions' : ''}`);
65
- await baseFacet.mockSearchWithFacetResponseSequence(
66
- facetResponses?.responses
67
- );
68
- configuration.configure({...options, useCase: useCaseEnum.insight});
69
- await insightSetup?.waitForInsightInterfaceInitialization();
70
- await Promise.all([
71
- baseFacet.waitForSearchResponse(),
72
- baseFacet.performSearch(),
73
- ]);
74
- await use(new FacetObject(page));
75
- },
76
- });
77
-
78
- export {expect} from '@playwright/test';
@@ -1,67 +0,0 @@
1
- import type {Locator, Page} from '@playwright/test';
2
-
3
- export class FacetObject {
4
- constructor(public page: Page) {
5
- this.page = page;
6
- }
7
-
8
- get facet(): Locator {
9
- return this.page.locator('c-quantic-facet');
10
- }
11
-
12
- get facetValue(): Locator {
13
- return this.facet.getByTestId('facet__value');
14
- }
15
-
16
- get facetValueInput(): Locator {
17
- return this.facet.getByRole('checkbox', {name: 'Facet value option'});
18
- }
19
-
20
- get showMoreFacetValuesButton(): Locator {
21
- return this.facet.getByRole('button', {
22
- name: /Show more values for the .* facet/i,
23
- });
24
- }
25
-
26
- get showLessFacetValuesButton(): Locator {
27
- return this.facet.getByRole('button', {
28
- name: /Show less values for the .* facet/i,
29
- });
30
- }
31
-
32
- get facetSearchBoxInput(): Locator {
33
- return this.facet.getByTestId('facet__searchbox-input').locator('input');
34
- }
35
-
36
- get facetBreadcrumb(): Locator {
37
- return this.page.getByTestId('facet-breadcrumb');
38
- }
39
-
40
- get clearSelectionButton(): Locator {
41
- return this.page.getByTestId('clear-selection-button');
42
- }
43
-
44
- facetBreadcrumbValueByIndex(index: number): Locator {
45
- return this.facetBreadcrumb.locator('c-quantic-pill').nth(index);
46
- }
47
-
48
- async clickOnFacetValue(index: number): Promise<void> {
49
- await this.facetValue.nth(index).click();
50
- }
51
-
52
- async clickOnShowMoreFacetValuesButton(): Promise<void> {
53
- await this.showMoreFacetValuesButton.click();
54
- }
55
-
56
- async clickOnShowLessFacetValuesButton(): Promise<void> {
57
- await this.showLessFacetValuesButton.click();
58
- }
59
-
60
- async fillFacetSearchBoxInput(query: string): Promise<void> {
61
- await this.facetSearchBoxInput.fill(query);
62
- }
63
-
64
- async clickOnClearSelectionButton(): Promise<void> {
65
- await this.clearSelectionButton.click();
66
- }
67
- }
@@ -1,242 +0,0 @@
1
- import {testSearch, testInsight, expect} from './fixture';
2
- import {
3
- useCaseEnum,
4
- useCaseTestCases,
5
- } from '../../../../../../playwright/utils/useCase';
6
- import {initialFacetData, expandedFacetData, selectedFacetData} from './data';
7
-
8
- const fixtures = {
9
- search: testSearch,
10
- insight: testInsight,
11
- };
12
-
13
- useCaseTestCases.forEach((useCase) => {
14
- let test = fixtures[useCase.value];
15
- test.describe(`quantic facet ${useCase.label}`, () => {
16
- test.describe('when selecting and deselecting a facet value', () => {
17
- test.use({
18
- facetResponses: {
19
- responses: [
20
- [initialFacetData],
21
- [selectedFacetData],
22
- [initialFacetData],
23
- ],
24
- },
25
- });
26
-
27
- test('should trigger a new search and log the corresponding UA analytics events', async ({
28
- baseFacet,
29
- facet,
30
- }) => {
31
- const selectedIndex = 0;
32
- const {facetId, field, values} = initialFacetData;
33
- const facetSelectUaRequest = baseFacet.waitForFacetSelectUaAnalytics({
34
- facetId,
35
- facetField: field,
36
- facetValue: values[selectedIndex].value,
37
- });
38
- let searchResponsePromise = baseFacet.waitForSearchResponse();
39
-
40
- await facet.clickOnFacetValue(selectedIndex);
41
-
42
- await facetSelectUaRequest;
43
- let searchResponse = await searchResponsePromise;
44
- const {analytics: analyticsForFacetSelect} =
45
- baseFacet.extractDataFromResponse(searchResponse);
46
- expect(analyticsForFacetSelect.actionCause).toEqual('facetSelect');
47
-
48
- const facetDeselectUaRequest =
49
- baseFacet.waitForFacetDeselectUaAnalytics({
50
- facetId,
51
- facetField: field,
52
- facetValue: values[selectedIndex].value,
53
- });
54
- searchResponsePromise = baseFacet.waitForSearchResponse();
55
-
56
- await facet.clickOnFacetValue(selectedIndex);
57
-
58
- await facetDeselectUaRequest;
59
- searchResponse = await searchResponsePromise;
60
- const {analytics: analyticsForFacetDeselect} =
61
- baseFacet.extractDataFromResponse(searchResponse);
62
- expect(analyticsForFacetDeselect.actionCause).toEqual('facetDeselect');
63
- });
64
- });
65
-
66
- test.describe('when selecting a facet value and clicking the clear filter button', () => {
67
- test.use({
68
- facetResponses: {
69
- responses: [
70
- [initialFacetData],
71
- [selectedFacetData],
72
- [initialFacetData],
73
- ],
74
- },
75
- });
76
-
77
- test('should trigger a new search and log the corresponding UA analytics events', async ({
78
- baseFacet,
79
- facet,
80
- }) => {
81
- const selectedIndex = 0;
82
- const {facetId, field, values} = initialFacetData;
83
- const facetSelectUaRequest = baseFacet.waitForFacetSelectUaAnalytics({
84
- facetId,
85
- facetField: field,
86
- facetValue: values[selectedIndex].value,
87
- });
88
- let searchResponsePromise = baseFacet.waitForSearchResponse();
89
-
90
- await facet.clickOnFacetValue(selectedIndex);
91
-
92
- await facetSelectUaRequest;
93
- let searchResponse = await searchResponsePromise;
94
- const {analytics: analyticsForFacetSelect} =
95
- baseFacet.extractDataFromResponse(searchResponse);
96
- expect(analyticsForFacetSelect.actionCause).toEqual('facetSelect');
97
-
98
- const clearAllUaRequest = baseFacet.waitForFacetClearAllUaAnalytics({
99
- facetId,
100
- facetField: field,
101
- });
102
- searchResponsePromise = baseFacet.waitForSearchResponse();
103
-
104
- await facet.clickOnClearSelectionButton();
105
-
106
- await clearAllUaRequest;
107
- searchResponse = await searchResponsePromise;
108
- const {analytics: analyticsForFacetDeselect} =
109
- baseFacet.extractDataFromResponse(searchResponse);
110
- expect(analyticsForFacetDeselect.actionCause).toEqual('facetClearAll');
111
- });
112
- });
113
-
114
- test.describe('when expanding and collapsing facet values using Show More/Less buttons', () => {
115
- test.use({
116
- facetResponses: {
117
- responses: [[initialFacetData], [expandedFacetData], [initialFacetData]],
118
- },
119
- options: {
120
- numberOfValues: 2,
121
- },
122
- });
123
-
124
- test('should fetch additional facet values and send correct UA analytics', async ({
125
- baseFacet,
126
- facet,
127
- }) => {
128
- const {facetId, field} = initialFacetData;
129
- const uaRequest = baseFacet.waitForShowMoreFacetResultsUaAnalytics({
130
- facetId,
131
- facetField: field,
132
- });
133
- let searchResponsePromise = baseFacet.waitForSearchResponse();
134
-
135
- await facet.clickOnShowMoreFacetValuesButton();
136
-
137
- await uaRequest;
138
- let searchResponse = await searchResponsePromise;
139
- const {analytics: analyticsForShowMore} =
140
- baseFacet.extractDataFromResponse(searchResponse);
141
- expect(analyticsForShowMore.actionCause).toEqual(
142
- 'showMoreFacetResults'
143
- );
144
-
145
- const showLessUaRequest =
146
- baseFacet.waitForShowLessFacetResultsUaAnalytics({
147
- facetId,
148
- facetField: field,
149
- });
150
- searchResponsePromise = baseFacet.waitForSearchResponse();
151
-
152
- await facet.clickOnShowLessFacetValuesButton();
153
-
154
- await showLessUaRequest;
155
- searchResponse = await searchResponsePromise;
156
- const {analytics: analyticsForShowLess} =
157
- baseFacet.extractDataFromResponse(searchResponse);
158
- expect(analyticsForShowLess.actionCause).toEqual(
159
- 'showLessFacetResults'
160
- );
161
- });
162
- });
163
-
164
- test.describe('when a custom caption is provided', () => {
165
- const exampleCaption = 'example caption';
166
- const facetValueIndex = 0;
167
-
168
- test.use({
169
- facetResponses: {
170
- responses: [[initialFacetData], [selectedFacetData]],
171
- },
172
- options: {
173
- caption: exampleCaption,
174
- value: initialFacetData.values[facetValueIndex].value,
175
- },
176
- });
177
- test('should display the custom caption instead of the raw facet value', async ({
178
- baseFacet,
179
- facet,
180
- }) => {
181
- expect(facet.facetValue.nth(facetValueIndex)).toHaveText(
182
- new RegExp(exampleCaption)
183
- );
184
- const {facetId, field, values} = initialFacetData;
185
- const uaRequest = baseFacet.waitForFacetSelectUaAnalytics({
186
- facetId,
187
- facetField: field,
188
- facetValue: values[facetValueIndex].value,
189
- });
190
- const searchResponsePromise = baseFacet.waitForSearchResponse();
191
-
192
- await facet.clickOnFacetValue(facetValueIndex);
193
-
194
- await uaRequest;
195
- await searchResponsePromise;
196
- expect(facet.facetBreadcrumbValueByIndex(facetValueIndex)).toHaveText(
197
- exampleCaption
198
- );
199
- });
200
- });
201
-
202
- if (useCase.value === useCaseEnum.search) {
203
- test.describe('when typing in the facet search box input', () => {
204
- test('should fetch facet values according to the query typed', async ({
205
- baseFacet,
206
- facet,
207
- }) => {
208
- const {field: expectedField} = initialFacetData;
209
- const exampleQuery = 'test';
210
- const facetSearchResponsePromise =
211
- baseFacet.waitForFacetSearchResponse();
212
-
213
- await facet.fillFacetSearchBoxInput(exampleQuery);
214
-
215
- const facetSearchResponse = await facetSearchResponsePromise;
216
- const {field, query} =
217
- baseFacet.extractDataFromResponse(facetSearchResponse);
218
- expect(field).toEqual(expectedField);
219
- expect(query).toContain(exampleQuery);
220
- });
221
- });
222
-
223
- test.describe('with a selected value in the URL', () => {
224
- const selectedIndex = 0;
225
- const {field, values} = initialFacetData;
226
- test.use({
227
- urlHash: `f-${field}=${values[selectedIndex].value}`,
228
- facetResponses: {
229
- responses: [],
230
- },
231
- });
232
-
233
- test('should select the correct facet value', async ({facet}) => {
234
- await expect(facet.facetValueInput.nth(selectedIndex)).toBeChecked();
235
- expect(facet.facetValue.nth(selectedIndex)).toHaveText(
236
- new RegExp(values[selectedIndex].value)
237
- );
238
- });
239
- });
240
- }
241
- });
242
- });
@@ -1,28 +0,0 @@
1
- // @ts-ignore
2
- import {createElement} from 'lwc';
3
- import QuanticFacetCaption from '../quanticFacetCaption';
4
-
5
- function createTestComponent(options) {
6
- const element = createElement('c-quantic-facet-caption', {
7
- is: QuanticFacetCaption,
8
- });
9
-
10
- for (const [key, value] of Object.entries(options)) {
11
- element[key] = value;
12
- }
13
-
14
- document.body.appendChild(element);
15
- return element;
16
- }
17
-
18
- describe('c-quantic-facet-caption', () => {
19
- it('should expose captions through the `captions` property', () => {
20
- const value = 'the-facet-value';
21
- const caption = 'The custom caption';
22
- const element = createTestComponent({value, caption});
23
-
24
- const captions = element.captions;
25
-
26
- expect(captions[value]).toBe(caption);
27
- });
28
- });
@@ -1,178 +0,0 @@
1
- /* eslint-disable no-import-assign */
2
- import QuanticFacetManager from '../quanticFacetManager';
3
- // @ts-ignore
4
- import {createElement} from 'lwc';
5
- import * as mockHeadlessLoader from 'c/quanticHeadlessLoader';
6
-
7
- jest.mock('c/quanticHeadlessLoader');
8
-
9
- let isInitialized = false;
10
-
11
- const exampleEngine = {
12
- id: 'exampleEngineId',
13
- };
14
-
15
- const defaultSearchStatusState = {
16
- hasResults: true,
17
- firstSearchExecuted: true,
18
- };
19
-
20
- let searchStatusState = defaultSearchStatusState;
21
-
22
- const defaultOptions = {
23
- engineId: exampleEngine.id,
24
- };
25
-
26
- const selectors = {
27
- initializationError: 'c-quantic-component-error',
28
- facetManagerHost: '.facet-manager__host',
29
- };
30
-
31
- const functionsMocks = {
32
- buildFacetManager: jest.fn(() => ({
33
- state: {},
34
- subscribe: functionsMocks.facetManagerStateSubscriber,
35
- })),
36
- buildSearchStatus: jest.fn(() => ({
37
- state: searchStatusState,
38
- subscribe: functionsMocks.searchStatusStateSubscriber,
39
- })),
40
- facetManagerStateSubscriber: jest.fn((cb) => {
41
- cb();
42
- return functionsMocks.facetManagerStateUnsubscriber;
43
- }),
44
- searchStatusStateSubscriber: jest.fn((cb) => {
45
- cb();
46
- return functionsMocks.searchStatusStateUnsubscriber;
47
- }),
48
- facetManagerStateUnsubscriber: jest.fn(),
49
- searchStatusStateUnsubscriber: jest.fn(),
50
- };
51
-
52
- function createTestComponent(options = defaultOptions) {
53
- const element = createElement('c-quantic-facet-manager', {
54
- is: QuanticFacetManager,
55
- });
56
- for (const [key, value] of Object.entries(options)) {
57
- element[key] = value;
58
- }
59
- document.body.appendChild(element);
60
- return element;
61
- }
62
-
63
- // Helper function to wait until the microtask queue is empty.
64
- function flushPromises() {
65
- return new Promise((resolve) => setTimeout(resolve, 0));
66
- }
67
-
68
- function prepareHeadlessState() {
69
- // @ts-ignore
70
- mockHeadlessLoader.getHeadlessBundle = () => {
71
- return {
72
- buildFacetManager: functionsMocks.buildFacetManager,
73
- buildSearchStatus: functionsMocks.buildSearchStatus,
74
- };
75
- };
76
- }
77
-
78
- function mockSuccessfulHeadlessInitialization() {
79
- // @ts-ignore
80
- mockHeadlessLoader.initializeWithHeadless = (element, _, initialize) => {
81
- if (element instanceof QuanticFacetManager && !isInitialized) {
82
- isInitialized = true;
83
- initialize(exampleEngine);
84
- }
85
- };
86
- }
87
-
88
- function mockErroneousHeadlessInitialization() {
89
- // @ts-ignore
90
- mockHeadlessLoader.initializeWithHeadless = (element) => {
91
- if (element instanceof QuanticFacetManager) {
92
- element.setInitializationError();
93
- }
94
- };
95
- }
96
-
97
- function cleanup() {
98
- // The jsdom instance is shared across test cases in a single file so reset the DOM
99
- while (document.body.firstChild) {
100
- document.body.removeChild(document.body.firstChild);
101
- }
102
- jest.clearAllMocks();
103
- isInitialized = false;
104
- }
105
-
106
- describe('c-quantic-facet-manager', () => {
107
- afterEach(() => {
108
- cleanup();
109
- });
110
-
111
- describe('controller initialization', () => {
112
- beforeEach(() => {
113
- mockSuccessfulHeadlessInitialization();
114
- prepareHeadlessState();
115
- });
116
-
117
- it('should build the facet manager controller with the proper parameters and subscribe to its state', async () => {
118
- createTestComponent();
119
- await flushPromises();
120
-
121
- expect(functionsMocks.buildFacetManager).toHaveBeenCalledTimes(1);
122
- expect(functionsMocks.buildFacetManager).toHaveBeenCalledWith(
123
- exampleEngine
124
- );
125
- expect(functionsMocks.facetManagerStateSubscriber).toHaveBeenCalledTimes(
126
- 1
127
- );
128
- });
129
-
130
- it('should build the search status controller with the proper parameters and subscribe to its state', async () => {
131
- createTestComponent();
132
- await flushPromises();
133
-
134
- expect(functionsMocks.buildSearchStatus).toHaveBeenCalledTimes(1);
135
- expect(functionsMocks.buildSearchStatus).toHaveBeenCalledWith(
136
- exampleEngine
137
- );
138
- expect(functionsMocks.searchStatusStateSubscriber).toHaveBeenCalledTimes(
139
- 1
140
- );
141
- });
142
- });
143
-
144
- describe('when an initialization error occurs', () => {
145
- beforeEach(() => {
146
- mockErroneousHeadlessInitialization();
147
- });
148
-
149
- it('should display the initialization error component', async () => {
150
- const element = createTestComponent();
151
- await flushPromises();
152
-
153
- const initializationError = element.shadowRoot.querySelector(
154
- selectors.initializationError
155
- );
156
-
157
- expect(initializationError).not.toBeNull();
158
- });
159
- });
160
-
161
- describe('when the component is initialized', () => {
162
- beforeEach(() => {
163
- mockSuccessfulHeadlessInitialization();
164
- prepareHeadlessState();
165
- });
166
-
167
- it('should properly render the facet manager component', async () => {
168
- const element = createTestComponent();
169
- await flushPromises();
170
-
171
- const facetManager = element.shadowRoot.querySelector(
172
- selectors.facetManagerHost
173
- );
174
-
175
- expect(facetManager).not.toBeNull();
176
- });
177
- });
178
- });