@coveo/quantic 3.43.2 → 3.43.3

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 (109) hide show
  1. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +70 -6
  2. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +17 -13
  3. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +34 -14
  4. package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +24 -4
  5. package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +17 -13
  6. package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +26 -4
  7. package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +50 -9
  8. package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +18 -13
  9. package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +43 -9
  10. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.html +3 -3
  11. package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +24 -4
  12. package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +17 -13
  13. package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +28 -6
  14. package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +3 -3
  15. package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +1 -1
  16. package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +3 -2
  17. package/force-app/main/default/lwc/quanticThreadItem/__tests__/quanticThreadItem.test.js +138 -0
  18. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.css +21 -0
  19. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.html +10 -2
  20. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.js +38 -1
  21. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/data.ts +66 -0
  22. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +20 -4
  23. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +24 -0
  24. package/force-app/main/default/staticresources/coveobueno/browser/bueno.js +1 -3
  25. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +2 -2
  26. package/force-app/main/default/staticresources/coveoheadless/definitions/app/insight-engine/insight-engine.d.ts +1 -1
  27. package/force-app/main/default/staticresources/coveoheadless/definitions/case-assist.index.d.ts +2 -2
  28. package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +6 -6
  29. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/breadcrumb-manager/headless-breadcrumb-manager.d.ts +1 -1
  30. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sort/headless-core-commerce-sort.d.ts +1 -1
  31. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/url-manager/headless-core-url-manager.d.ts +1 -1
  32. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-listing/headless-product-listing.d.ts +1 -1
  33. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/recommendations/headless-recommendations.d.ts +1 -1
  34. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search/headless-search.d.ts +1 -1
  35. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/context/headless-core-context.d.ts +0 -1
  36. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/did-you-mean/headless-core-did-you-mean.d.ts +0 -1
  37. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facet-manager/headless-core-facet-manager.d.ts +0 -1
  38. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/category-facet/headless-core-category-facet.d.ts +0 -4
  39. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/facet/headless-core-facet.d.ts +0 -5
  40. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-core-date-facet.d.ts +1 -5
  41. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-core-date-filter.d.ts +0 -1
  42. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-facet.d.ts +0 -1
  43. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-filter.d.ts +0 -1
  44. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/folded-result-list/headless-core-folded-result-list.d.ts +0 -1
  45. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/pager/headless-core-pager.d.ts +0 -2
  46. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/query-error/headless-core-query-error.d.ts +0 -1
  47. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/recent-queries-list/headless-core-recent-queries-list.d.ts +0 -1
  48. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/result-list/headless-core-result-list.d.ts +0 -2
  49. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/results-per-page/headless-core-results-per-page.d.ts +0 -1
  50. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/sort/headless-core-sort.d.ts +0 -2
  51. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/status/headless-core-status.d.ts +0 -1
  52. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/tab/headless-core-tab.d.ts +0 -1
  53. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-notify-trigger.d.ts +0 -1
  54. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-query-trigger.d.ts +0 -1
  55. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-redirection-trigger.d.ts +0 -1
  56. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/dictionary-field-context/headless-dictionary-field-context.d.ts +0 -1
  57. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/document-suggestion-list/case-assist-headless-interactive-result.d.ts +1 -1
  58. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/automatic-facet-generator/headless-automatic-facet-generator.d.ts +0 -4
  59. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/category-facet/headless-category-facet.d.ts +2 -0
  60. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/facet/headless-facet.d.ts +2 -0
  61. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/field-suggestions/category-facet/headless-category-field-suggestions.d.ts +0 -1
  62. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/field-suggestions/facet/headless-field-suggestions.d.ts +0 -1
  63. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-interactive-citation.d.ts +1 -1
  64. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/history-manager/headless-history-manager.d.ts +0 -1
  65. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facet-conditions-manager/headless-facet-conditions-manager.d.ts +1 -1
  66. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/generated-answer/headless-insight-interactive-citation.d.ts +1 -1
  67. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/result-list/headless-insight-interactive-result.d.ts +1 -1
  68. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/results-per-page/headless-insight-results-per-page.d.ts +1 -1
  69. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/instant-results/instant-results.d.ts +1 -1
  70. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/pager/headless-pager.d.ts +2 -0
  71. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/query-summary/headless-query-summary.d.ts +1 -1
  72. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/quickview/headless-quickview.d.ts +1 -2
  73. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recent-results-list/headless-recent-results-list.d.ts +0 -1
  74. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/headless-recommendation.d.ts +0 -1
  75. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/result-list/headless-recommendation-interactive-result.d.ts +1 -1
  76. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/relevance-inspector/headless-relevance-inspector.d.ts +0 -1
  77. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-interactive-result.d.ts +1 -1
  78. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-result-list.d.ts +2 -0
  79. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/results-per-page/headless-results-per-page.d.ts +1 -1
  80. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/smart-snippet-questions-list/headless-smart-snippet-questions-list.d.ts +0 -1
  81. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/sort/headless-sort.d.ts +2 -0
  82. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/standalone-search-box/headless-standalone-search-box.d.ts +1 -1
  83. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/static-filter/headless-static-filter.d.ts +1 -2
  84. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/triggers/headless-execute-trigger.d.ts +0 -4
  85. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/url-manager/headless-url-manager.d.ts +0 -1
  86. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/configuration/configuration-actions-loader.d.ts +1 -1
  87. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/cart/cart-actions-loader.d.ts +1 -1
  88. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/context-actions-loader.d.ts +1 -1
  89. package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/category-facet/category-facet-actions-loader.d.ts +1 -1
  90. package/force-app/main/default/staticresources/coveoheadless/definitions/features/folding/insight-folding-actions.d.ts +1 -1
  91. package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/insight-query-set-actions-loader.d.ts +1 -1
  92. package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/insight-search-actions-loader.d.ts +1 -1
  93. package/force-app/main/default/staticresources/coveoheadless/definitions/features/query-set/query-set-actions-loader.d.ts +1 -1
  94. package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +7 -7
  95. package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +2 -2
  96. package/force-app/main/default/staticresources/coveoheadless/definitions/recommendation.index.d.ts +2 -2
  97. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
  98. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
  99. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce-next.index.d.ts +4 -4
  100. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +4 -4
  101. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
  102. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
  103. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +1 -1
  104. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next.index.d.ts +6 -6
  105. package/force-app/main/default/staticresources/coveoheadless/definitions/ssr.index.d.ts +6 -6
  106. package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
  107. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
  108. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +3 -3
  109. package/package.json +3 -3
@@ -0,0 +1,66 @@
1
+ const facetId = 'Date';
2
+ const field = 'Date';
3
+
4
+ /**
5
+ * Facet response before any value is selected.
6
+ * The values mirror the relative timeframes declared on the exampleQuanticTimeframeFacet.html file
7
+ */
8
+ export const initialFacetData = {
9
+ facetId,
10
+ field,
11
+ moreValuesAvailable: false,
12
+ values: [
13
+ {
14
+ start: 'now',
15
+ end: 'next-1-year',
16
+ endInclusive: false,
17
+ state: 'idle',
18
+ numberOfResults: 10,
19
+ },
20
+ {
21
+ start: 'past-2-week',
22
+ end: 'now',
23
+ endInclusive: false,
24
+ state: 'idle',
25
+ numberOfResults: 20,
26
+ },
27
+ {
28
+ start: 'past-1-month',
29
+ end: 'now',
30
+ endInclusive: false,
31
+ state: 'idle',
32
+ numberOfResults: 30,
33
+ },
34
+ {
35
+ start: 'past-1-year',
36
+ end: 'now',
37
+ endInclusive: false,
38
+ state: 'idle',
39
+ numberOfResults: 40,
40
+ },
41
+ {
42
+ start: 'past-10-year',
43
+ end: 'now',
44
+ endInclusive: false,
45
+ state: 'idle',
46
+ numberOfResults: 50,
47
+ },
48
+ ],
49
+ indexScore: 0.4,
50
+ };
51
+
52
+ const [firstRange, ...remainingRanges] = initialFacetData.values;
53
+
54
+ /**
55
+ * Facet response after the first value is selected.
56
+ */
57
+ export const selectedFacetData = {
58
+ ...initialFacetData,
59
+ values: [
60
+ {
61
+ ...firstRange,
62
+ state: 'selected',
63
+ },
64
+ ...remainingRanges,
65
+ ],
66
+ };
@@ -6,6 +6,7 @@ import {
6
6
  insightSearchRequestRegex,
7
7
  } from '../../../../../../playwright/utils/requests';
8
8
  import {BaseFacetObject} from '../../../../../../playwright/page-object/baseFacetObject';
9
+ import {initialFacetData} from './data';
9
10
  import {facetBase} from '../../../../../../playwright/fixtures/baseFacetFixture';
10
11
 
11
12
  const pageUrl = 's/quantic-timeframe-facet';
@@ -22,11 +23,20 @@ type QuanticFacetE2EFixtures = {
22
23
 
23
24
  export const testSearch = facetBase.extend<QuanticFacetE2EFixtures>({
24
25
  options: {withDatePicker: true},
26
+ facetResponses: {responses: [[initialFacetData]]},
25
27
  baseFacet: async ({page}, use) => {
26
28
  await use(new BaseFacetObject(page, searchRequestRegex));
27
29
  },
28
- facet: async ({page, options, configuration, baseFacet, urlHash}, use) => {
30
+ facet: async (
31
+ {page, options, configuration, baseFacet, urlHash, facetResponses},
32
+ use
33
+ ) => {
34
+ // search use case: interface auto-triggers a search on load, hence the mockSearchWithBaseResponse call below
35
+ await baseFacet.mockSearchWithBaseResponse();
29
36
  await page.goto(`${pageUrl}#${urlHash ? urlHash : ''}`);
37
+ await baseFacet.mockSearchWithFacetResponseSequence(
38
+ facetResponses?.responses
39
+ );
30
40
  configuration.configure(options);
31
41
  await baseFacet.waitForSearchResponse();
32
42
 
@@ -36,6 +46,7 @@ export const testSearch = facetBase.extend<QuanticFacetE2EFixtures>({
36
46
 
37
47
  export const testInsight = facetBase.extend<QuanticFacetE2EFixtures>({
38
48
  options: {withDatePicker: true},
49
+ facetResponses: {responses: [[initialFacetData]]},
39
50
  baseFacet: async ({page}, use) => {
40
51
  await use(new BaseFacetObject(page, insightSearchRequestRegex));
41
52
  },
@@ -43,14 +54,19 @@ export const testInsight = facetBase.extend<QuanticFacetE2EFixtures>({
43
54
  await use(new InsightSetupObject(page));
44
55
  },
45
56
  facet: async (
46
- {page, options, baseFacet, configuration, insightSetup},
57
+ {page, options, baseFacet, configuration, insightSetup, facetResponses},
47
58
  use
48
59
  ) => {
49
60
  await page.goto(pageUrl);
61
+ await baseFacet.mockSearchWithFacetResponseSequence(
62
+ facetResponses?.responses
63
+ );
50
64
  configuration.configure({...options, useCase: useCaseEnum.insight});
51
65
  await insightSetup?.waitForInsightInterfaceInitialization();
52
- await baseFacet.performSearch();
53
- await baseFacet.waitForSearchResponse();
66
+ await Promise.all([
67
+ baseFacet.waitForSearchResponse(),
68
+ baseFacet.performSearch(),
69
+ ]);
54
70
  await use(new TimeframeFacetObject(page));
55
71
  },
56
72
  });
@@ -3,6 +3,7 @@ import {
3
3
  useCaseEnum,
4
4
  useCaseTestCases,
5
5
  } from '../../../../../../playwright/utils/useCase';
6
+ import {initialFacetData, selectedFacetData} from './data';
6
7
 
7
8
  const fixtures = {
8
9
  search: testSearch,
@@ -15,6 +16,16 @@ useCaseTestCases.forEach((useCase) => {
15
16
  let test = fixtures[useCase.value];
16
17
  test.describe(`quantic timeframe facet ${useCase.label}`, () => {
17
18
  test.describe('when selecting and deselecting a facet value', () => {
19
+ test.use({
20
+ facetResponses: {
21
+ responses: [
22
+ [initialFacetData],
23
+ [selectedFacetData],
24
+ [initialFacetData],
25
+ ],
26
+ },
27
+ });
28
+
18
29
  test('should trigger a new search and log the corresponding UA analytics events', async ({
19
30
  baseFacet,
20
31
  facet,
@@ -59,6 +70,16 @@ useCaseTestCases.forEach((useCase) => {
59
70
  });
60
71
 
61
72
  test.describe('when selecting a facet value and clicking the clear filter button', () => {
73
+ test.use({
74
+ facetResponses: {
75
+ responses: [
76
+ [initialFacetData],
77
+ [selectedFacetData],
78
+ [initialFacetData],
79
+ ],
80
+ },
81
+ });
82
+
62
83
  test('should trigger a new search and log the corresponding UA analytics events', async ({
63
84
  baseFacet,
64
85
  facet,
@@ -143,6 +164,9 @@ useCaseTestCases.forEach((useCase) => {
143
164
  const yesterdayDate = date.toISOString().slice(0, 10);
144
165
  test.use({
145
166
  urlHash: `df-${exampleField}=${yesterdayDate.replaceAll('-', '/')}@00:00:00..${todayDate.replaceAll('-', '/')}@23:59:59`,
167
+ facetResponses: {
168
+ responses: [],
169
+ },
146
170
  });
147
171
 
148
172
  test('should select the correct facet value', async ({facet}) => {
@@ -383,9 +383,7 @@ var EnumValue = class {
383
383
  if (isUndefined(value)) {
384
384
  return null;
385
385
  }
386
- const valueInEnum = Object.values(this.config.enum).find(
387
- (enumValue) => enumValue === value
388
- );
386
+ const valueInEnum = Object.values(this.config.enum).find((enumValue) => enumValue === value);
389
387
  if (!valueInEnum) {
390
388
  return "value is not in enum.";
391
389
  }