@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.
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +70 -6
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +17 -13
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +34 -14
- package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +24 -4
- package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +17 -13
- package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +26 -4
- package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +50 -9
- package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +18 -13
- package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +43 -9
- package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.html +3 -3
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +24 -4
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +17 -13
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +28 -6
- package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +3 -3
- package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +1 -1
- package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +3 -2
- package/force-app/main/default/lwc/quanticThreadItem/__tests__/quanticThreadItem.test.js +138 -0
- package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.css +21 -0
- package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.html +10 -2
- package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.js +38 -1
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/data.ts +66 -0
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +20 -4
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +24 -0
- package/force-app/main/default/staticresources/coveobueno/browser/bueno.js +1 -3
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/insight-engine/insight-engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/case-assist.index.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +6 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/breadcrumb-manager/headless-breadcrumb-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sort/headless-core-commerce-sort.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/url-manager/headless-core-url-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-listing/headless-product-listing.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/recommendations/headless-recommendations.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search/headless-search.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/context/headless-core-context.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/did-you-mean/headless-core-did-you-mean.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facet-manager/headless-core-facet-manager.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/category-facet/headless-core-category-facet.d.ts +0 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/facet/headless-core-facet.d.ts +0 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-core-date-facet.d.ts +1 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-core-date-filter.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-facet.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-filter.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/folded-result-list/headless-core-folded-result-list.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/pager/headless-core-pager.d.ts +0 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/query-error/headless-core-query-error.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/recent-queries-list/headless-core-recent-queries-list.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/result-list/headless-core-result-list.d.ts +0 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/results-per-page/headless-core-results-per-page.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/sort/headless-core-sort.d.ts +0 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/status/headless-core-status.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/tab/headless-core-tab.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-notify-trigger.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-query-trigger.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-redirection-trigger.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/dictionary-field-context/headless-dictionary-field-context.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/document-suggestion-list/case-assist-headless-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/automatic-facet-generator/headless-automatic-facet-generator.d.ts +0 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/category-facet/headless-category-facet.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/facet/headless-facet.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/field-suggestions/category-facet/headless-category-field-suggestions.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/field-suggestions/facet/headless-field-suggestions.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-interactive-citation.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/history-manager/headless-history-manager.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facet-conditions-manager/headless-facet-conditions-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/generated-answer/headless-insight-interactive-citation.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/result-list/headless-insight-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/results-per-page/headless-insight-results-per-page.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/instant-results/instant-results.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/pager/headless-pager.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/query-summary/headless-query-summary.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/quickview/headless-quickview.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recent-results-list/headless-recent-results-list.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/headless-recommendation.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/result-list/headless-recommendation-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/relevance-inspector/headless-relevance-inspector.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-result-list.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/results-per-page/headless-results-per-page.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/smart-snippet-questions-list/headless-smart-snippet-questions-list.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/sort/headless-sort.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/standalone-search-box/headless-standalone-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/static-filter/headless-static-filter.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/triggers/headless-execute-trigger.d.ts +0 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/url-manager/headless-url-manager.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/configuration/configuration-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/cart/cart-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/context-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/category-facet/category-facet-actions-loader.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/insight-search/insight-query-set-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/insight-search-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/query-set/query-set-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +7 -7
- package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/recommendation.index.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce-next.index.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next.index.d.ts +6 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr.index.d.ts +6 -6
- package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +3 -3
- package/package.json +3 -3
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
useCaseEnum,
|
|
4
4
|
useCaseTestCases,
|
|
5
5
|
} from '../../../../../../playwright/utils/useCase';
|
|
6
|
-
import
|
|
6
|
+
import {initialFacetData, expandedFacetData, selectedFacetData} from './data';
|
|
7
7
|
|
|
8
8
|
const fixtures = {
|
|
9
9
|
search: testSearch,
|
|
@@ -14,12 +14,22 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
14
14
|
let test = fixtures[useCase.value];
|
|
15
15
|
test.describe(`quantic facet ${useCase.label}`, () => {
|
|
16
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
|
+
|
|
17
27
|
test('should trigger a new search and log the corresponding UA analytics events', async ({
|
|
18
28
|
baseFacet,
|
|
19
29
|
facet,
|
|
20
30
|
}) => {
|
|
21
31
|
const selectedIndex = 0;
|
|
22
|
-
const {facetId, field, values} =
|
|
32
|
+
const {facetId, field, values} = initialFacetData;
|
|
23
33
|
const facetSelectUaRequest = baseFacet.waitForFacetSelectUaAnalytics({
|
|
24
34
|
facetId,
|
|
25
35
|
facetField: field,
|
|
@@ -54,12 +64,22 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
54
64
|
});
|
|
55
65
|
|
|
56
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
|
+
|
|
57
77
|
test('should trigger a new search and log the corresponding UA analytics events', async ({
|
|
58
78
|
baseFacet,
|
|
59
79
|
facet,
|
|
60
80
|
}) => {
|
|
61
81
|
const selectedIndex = 0;
|
|
62
|
-
const {facetId, field, values} =
|
|
82
|
+
const {facetId, field, values} = initialFacetData;
|
|
63
83
|
const facetSelectUaRequest = baseFacet.waitForFacetSelectUaAnalytics({
|
|
64
84
|
facetId,
|
|
65
85
|
facetField: field,
|
|
@@ -92,11 +112,20 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
92
112
|
});
|
|
93
113
|
|
|
94
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
|
+
|
|
95
124
|
test('should fetch additional facet values and send correct UA analytics', async ({
|
|
96
125
|
baseFacet,
|
|
97
126
|
facet,
|
|
98
127
|
}) => {
|
|
99
|
-
const {facetId, field} =
|
|
128
|
+
const {facetId, field} = initialFacetData;
|
|
100
129
|
const uaRequest = baseFacet.waitForShowMoreFacetResultsUaAnalytics({
|
|
101
130
|
facetId,
|
|
102
131
|
facetField: field,
|
|
@@ -137,9 +166,12 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
137
166
|
const facetValueIndex = 0;
|
|
138
167
|
|
|
139
168
|
test.use({
|
|
169
|
+
facetResponses: {
|
|
170
|
+
responses: [[initialFacetData], [selectedFacetData]],
|
|
171
|
+
},
|
|
140
172
|
options: {
|
|
141
173
|
caption: exampleCaption,
|
|
142
|
-
value:
|
|
174
|
+
value: initialFacetData.values[facetValueIndex].value,
|
|
143
175
|
},
|
|
144
176
|
});
|
|
145
177
|
test('should display the custom caption instead of the raw facet value', async ({
|
|
@@ -149,7 +181,7 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
149
181
|
expect(facet.facetValue.nth(facetValueIndex)).toHaveText(
|
|
150
182
|
new RegExp(exampleCaption)
|
|
151
183
|
);
|
|
152
|
-
const {facetId, field, values} =
|
|
184
|
+
const {facetId, field, values} = initialFacetData;
|
|
153
185
|
const uaRequest = baseFacet.waitForFacetSelectUaAnalytics({
|
|
154
186
|
facetId,
|
|
155
187
|
facetField: field,
|
|
@@ -173,7 +205,7 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
173
205
|
baseFacet,
|
|
174
206
|
facet,
|
|
175
207
|
}) => {
|
|
176
|
-
const {field: expectedField} =
|
|
208
|
+
const {field: expectedField} = initialFacetData;
|
|
177
209
|
const exampleQuery = 'test';
|
|
178
210
|
const facetSearchResponsePromise =
|
|
179
211
|
baseFacet.waitForFacetSearchResponse();
|
|
@@ -190,10 +222,12 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
190
222
|
|
|
191
223
|
test.describe('with a selected value in the URL', () => {
|
|
192
224
|
const selectedIndex = 0;
|
|
193
|
-
const {field, values} =
|
|
225
|
+
const {field, values} = initialFacetData;
|
|
194
226
|
test.use({
|
|
195
227
|
urlHash: `f-${field}=${values[selectedIndex].value}`,
|
|
196
|
-
|
|
228
|
+
facetResponses: {
|
|
229
|
+
responses: [],
|
|
230
|
+
},
|
|
197
231
|
});
|
|
198
232
|
|
|
199
233
|
test('should select the correct facet value', async ({facet}) => {
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
</template>
|
|
88
88
|
<template lwc:if={cannotAnswer}>
|
|
89
89
|
<template lwc:if={isManualAnswerGeneration}>
|
|
90
|
-
<div data-testid="generated-answer__no-answer-card" class="slds-box">
|
|
91
|
-
<div class="generated-answer__card-header slds-grid slds-grid_vertical-align-center slds-border_bottom slds-p-
|
|
90
|
+
<div data-testid="generated-answer__no-answer-card" class="slds-box slds-p-around_none">
|
|
91
|
+
<div class="generated-answer__card-header slds-grid slds-grid_vertical-align-center slds-border_bottom slds-p-around_small">
|
|
92
92
|
<div class="generated-answer__header-title slds-grid slds-grid_vertical-align-center">
|
|
93
93
|
<lightning-icon
|
|
94
94
|
icon-name="utility:sparkles"
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
</div>
|
|
102
102
|
<div
|
|
103
103
|
data-testid="generated-answer__no-answer-message"
|
|
104
|
-
class="generated-answer__content slds-
|
|
104
|
+
class="generated-answer__content slds-p-around_small"
|
|
105
105
|
>
|
|
106
106
|
<div class={generatedAnswerClass}>
|
|
107
107
|
<slot name="no-answer-message">{labels.noGeneratedAnswer}</slot>
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
const
|
|
1
|
+
const facetId = 'ytlikecount';
|
|
2
|
+
const field = 'ytlikecount';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Facet response before any value is selected.
|
|
6
|
+
*/
|
|
7
|
+
export const initialFacetData = {
|
|
2
8
|
domain: {
|
|
3
9
|
start: 0,
|
|
4
10
|
end: 200,
|
|
5
11
|
},
|
|
6
|
-
facetId
|
|
7
|
-
field
|
|
12
|
+
facetId,
|
|
13
|
+
field,
|
|
8
14
|
moreValuesAvailable: false,
|
|
9
15
|
values: [
|
|
10
16
|
{
|
|
@@ -25,4 +31,18 @@ const facetData = {
|
|
|
25
31
|
indexScore: 0.4,
|
|
26
32
|
};
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
const [firstRange, secondRange] = initialFacetData.values;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Facet response after the first value is selected.
|
|
38
|
+
*/
|
|
39
|
+
export const selectedFacetData = {
|
|
40
|
+
...initialFacetData,
|
|
41
|
+
values: [
|
|
42
|
+
{
|
|
43
|
+
...firstRange,
|
|
44
|
+
state: 'selected',
|
|
45
|
+
},
|
|
46
|
+
secondRange,
|
|
47
|
+
],
|
|
48
|
+
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
insightSearchRequestRegex,
|
|
7
7
|
} from '../../../../../../playwright/utils/requests';
|
|
8
8
|
import {BaseFacetObject} from '../../../../../../playwright/page-object/baseFacetObject';
|
|
9
|
-
import
|
|
9
|
+
import {initialFacetData} from './data';
|
|
10
10
|
import {facetBase} from '../../../../../../playwright/fixtures/baseFacetFixture';
|
|
11
11
|
|
|
12
12
|
const pageUrl = 's/quantic-numeric-facet';
|
|
@@ -23,18 +23,20 @@ type QuanticNumericFacetE2EFixtures = {
|
|
|
23
23
|
|
|
24
24
|
export const testSearch = facetBase.extend<QuanticNumericFacetE2EFixtures>({
|
|
25
25
|
options: {withInput: true},
|
|
26
|
-
|
|
26
|
+
facetResponses: {responses: [[initialFacetData]]},
|
|
27
27
|
baseFacet: async ({page}, use) => {
|
|
28
28
|
await use(new BaseFacetObject(page, searchRequestRegex));
|
|
29
29
|
},
|
|
30
30
|
facet: async (
|
|
31
|
-
{page, options, configuration, baseFacet, urlHash,
|
|
31
|
+
{page, options, configuration, baseFacet, urlHash, facetResponses},
|
|
32
32
|
use
|
|
33
33
|
) => {
|
|
34
|
+
// search use case: interface auto-triggers a search on load, hence the mockSearchWithBaseResponse call below
|
|
35
|
+
await baseFacet.mockSearchWithBaseResponse();
|
|
34
36
|
await page.goto(`${pageUrl}#${urlHash ? urlHash : ''}`);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
await baseFacet.mockSearchWithFacetResponseSequence(
|
|
38
|
+
facetResponses?.responses
|
|
39
|
+
);
|
|
38
40
|
|
|
39
41
|
configuration.configure(options);
|
|
40
42
|
await baseFacet.waitForSearchResponse();
|
|
@@ -45,7 +47,7 @@ export const testSearch = facetBase.extend<QuanticNumericFacetE2EFixtures>({
|
|
|
45
47
|
|
|
46
48
|
export const testInsight = facetBase.extend<QuanticNumericFacetE2EFixtures>({
|
|
47
49
|
options: {withInput: true},
|
|
48
|
-
|
|
50
|
+
facetResponses: {responses: [[initialFacetData]]},
|
|
49
51
|
baseFacet: async ({page}, use) => {
|
|
50
52
|
await use(new BaseFacetObject(page, insightSearchRequestRegex));
|
|
51
53
|
},
|
|
@@ -53,17 +55,19 @@ export const testInsight = facetBase.extend<QuanticNumericFacetE2EFixtures>({
|
|
|
53
55
|
await use(new InsightSetupObject(page));
|
|
54
56
|
},
|
|
55
57
|
facet: async (
|
|
56
|
-
{page, options, baseFacet, configuration, insightSetup,
|
|
58
|
+
{page, options, baseFacet, configuration, insightSetup, facetResponses},
|
|
57
59
|
use
|
|
58
60
|
) => {
|
|
59
61
|
await page.goto(pageUrl);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
await baseFacet.mockSearchWithFacetResponseSequence(
|
|
63
|
+
facetResponses?.responses
|
|
64
|
+
);
|
|
63
65
|
configuration.configure({...options, useCase: useCaseEnum.insight});
|
|
64
66
|
await insightSetup?.waitForInsightInterfaceInitialization();
|
|
65
|
-
await
|
|
66
|
-
|
|
67
|
+
await Promise.all([
|
|
68
|
+
baseFacet.waitForSearchResponse(),
|
|
69
|
+
baseFacet.performSearch(),
|
|
70
|
+
]);
|
|
67
71
|
await use(new NumericFacetObject(page));
|
|
68
72
|
},
|
|
69
73
|
});
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
useCaseEnum,
|
|
4
4
|
useCaseTestCases,
|
|
5
5
|
} from '../../../../../../playwright/utils/useCase';
|
|
6
|
-
import
|
|
6
|
+
import {initialFacetData, selectedFacetData} from './data';
|
|
7
7
|
|
|
8
8
|
const fixtures = {
|
|
9
9
|
search: testSearch,
|
|
@@ -14,12 +14,22 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
14
14
|
let test = fixtures[useCase.value];
|
|
15
15
|
test.describe(`quantic numeric facet ${useCase.label}`, () => {
|
|
16
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
|
+
|
|
17
27
|
test('should trigger a new search and log the corresponding UA analytics events', async ({
|
|
18
28
|
baseFacet,
|
|
19
29
|
facet,
|
|
20
30
|
}) => {
|
|
21
31
|
const selectedIndex = 0;
|
|
22
|
-
const {facetId, field, values} =
|
|
32
|
+
const {facetId, field, values} = initialFacetData;
|
|
23
33
|
const expectedFacetData = {
|
|
24
34
|
facetId,
|
|
25
35
|
facetField: field,
|
|
@@ -61,12 +71,22 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
61
71
|
});
|
|
62
72
|
|
|
63
73
|
test.describe('when selecting a facet value and clicking the clear filter button', () => {
|
|
74
|
+
test.use({
|
|
75
|
+
facetResponses: {
|
|
76
|
+
responses: [
|
|
77
|
+
[initialFacetData],
|
|
78
|
+
[selectedFacetData],
|
|
79
|
+
[initialFacetData],
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
64
84
|
test('should trigger a new search and log the corresponding UA analytics events', async ({
|
|
65
85
|
baseFacet,
|
|
66
86
|
facet,
|
|
67
87
|
}) => {
|
|
68
88
|
const selectedIndex = 0;
|
|
69
|
-
const {facetId, field, values} =
|
|
89
|
+
const {facetId, field, values} = initialFacetData;
|
|
70
90
|
const expectedFacetData = {
|
|
71
91
|
facetId,
|
|
72
92
|
facetField: field,
|
|
@@ -113,7 +133,7 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
113
133
|
}) => {
|
|
114
134
|
const exampleMin = '1';
|
|
115
135
|
const exampleMax = '2';
|
|
116
|
-
const {facetId, field} =
|
|
136
|
+
const {facetId, field} = initialFacetData;
|
|
117
137
|
const expectedFacetData = {
|
|
118
138
|
facetId: `${facetId}_input`,
|
|
119
139
|
facetField: field,
|
|
@@ -144,10 +164,12 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
144
164
|
if (useCase.value === useCaseEnum.search) {
|
|
145
165
|
test.describe('with a selected value in the URL', () => {
|
|
146
166
|
const selectedIndex = 0;
|
|
147
|
-
const {field, values} =
|
|
167
|
+
const {field, values} = initialFacetData;
|
|
148
168
|
test.use({
|
|
149
169
|
urlHash: `nf-${field}=${values[selectedIndex].start}...${values[selectedIndex].end}`,
|
|
150
|
-
|
|
170
|
+
facetResponses: {
|
|
171
|
+
responses: [],
|
|
172
|
+
},
|
|
151
173
|
});
|
|
152
174
|
|
|
153
175
|
test('should select the correct facet value', async ({facet}) => {
|
|
@@ -34,6 +34,7 @@ export const testSearch = quanticBase.extend<QuanticPagerE2ESearchFixtures>({
|
|
|
34
34
|
await use(new SearchObject(page, searchRequestRegex));
|
|
35
35
|
},
|
|
36
36
|
pager: async ({page, options, configuration, search, urlHash}, use) => {
|
|
37
|
+
await search.mockSearchWithBaseResponse();
|
|
37
38
|
await page.goto(urlHash ? `${pageUrl}#${urlHash}` : pageUrl);
|
|
38
39
|
const searchResponsePromise = search.waitForSearchResponse();
|
|
39
40
|
configuration.configure(options);
|
|
@@ -52,12 +53,11 @@ export const testInsight = quanticBase.extend<QuanticPagerE2EInsightFixtures>({
|
|
|
52
53
|
await use(new InsightSetupObject(page));
|
|
53
54
|
},
|
|
54
55
|
pager: async ({page, options, search, configuration, insightSetup}, use) => {
|
|
56
|
+
await search.mockSearchWithBaseResponse();
|
|
55
57
|
await page.goto(pageUrl);
|
|
56
58
|
configuration.configure({...options, useCase: useCaseEnum.insight});
|
|
57
59
|
await insightSetup.waitForInsightInterfaceInitialization();
|
|
58
|
-
|
|
59
|
-
await search.performSearch();
|
|
60
|
-
await searchResponsePromise;
|
|
60
|
+
await Promise.all([search.waitForSearchResponse(), search.performSearch()]);
|
|
61
61
|
await use(new PagerObject(page));
|
|
62
62
|
},
|
|
63
63
|
});
|
|
@@ -52,7 +52,7 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
52
52
|
pager,
|
|
53
53
|
search,
|
|
54
54
|
}) => {
|
|
55
|
-
const examplePage =
|
|
55
|
+
const examplePage = 2;
|
|
56
56
|
const searchResponsePromise = search.waitForSearchResponse();
|
|
57
57
|
const pagerPageUaAnalyticsPromise =
|
|
58
58
|
pager.waitForPagerNumberUaAnalytics();
|
|
@@ -33,6 +33,7 @@ export const testSearch = quanticBase.extend<QuanticSortE2ESearchFixtures>({
|
|
|
33
33
|
await use(new SearchObject(page, searchRequestRegex));
|
|
34
34
|
},
|
|
35
35
|
sort: async ({page, options, configuration, search, urlHash}, use) => {
|
|
36
|
+
await search.mockSearchWithBaseResponse();
|
|
36
37
|
await page.goto(urlHash ? `${sortUrl}#${urlHash}` : sortUrl);
|
|
37
38
|
configuration.configure(options);
|
|
38
39
|
await search.waitForSearchResponse();
|
|
@@ -49,11 +50,11 @@ export const testInsight = quanticBase.extend<QuanticSortE2EInsightFixtures>({
|
|
|
49
50
|
await use(new InsightSetupObject(page));
|
|
50
51
|
},
|
|
51
52
|
sort: async ({page, options, search, configuration, insightSetup}, use) => {
|
|
53
|
+
await search.mockSearchWithBaseResponse();
|
|
52
54
|
await page.goto(sortUrl);
|
|
53
55
|
configuration.configure({...options, useCase: useCaseEnum.insight});
|
|
54
56
|
await insightSetup.waitForInsightInterfaceInitialization();
|
|
55
|
-
await search.performSearch();
|
|
56
|
-
await search.waitForSearchResponse();
|
|
57
|
+
await Promise.all([search.waitForSearchResponse(), search.performSearch()]);
|
|
57
58
|
await use(new SortObject(page));
|
|
58
59
|
},
|
|
59
60
|
});
|
|
@@ -9,6 +9,7 @@ const selectors = {
|
|
|
9
9
|
contentWrapper: '[data-testid="thread-item-content"]',
|
|
10
10
|
visibleContent: '[data-testid="thread-item-content"] > div:not([hidden])',
|
|
11
11
|
line: '[data-testid="thread-item-line"]',
|
|
12
|
+
lineColumn: '[data-testid="thread-item-line-column"]',
|
|
12
13
|
dot: '[data-testid="thread-item-dot"]',
|
|
13
14
|
};
|
|
14
15
|
|
|
@@ -87,6 +88,52 @@ describe('c-quantic-thread-item', () => {
|
|
|
87
88
|
const dot = element.shadowRoot.querySelector(selectors.dot);
|
|
88
89
|
expect(dot.className).not.toContain('thread-item__dot--expanded');
|
|
89
90
|
});
|
|
91
|
+
|
|
92
|
+
it('dot has interactive class when collapse is enabled', async () => {
|
|
93
|
+
const element = createTestComponent();
|
|
94
|
+
await flushPromises();
|
|
95
|
+
|
|
96
|
+
const dot = element.shadowRoot.querySelector(selectors.dot);
|
|
97
|
+
expect(dot.className).toContain('thread-item__dot--interactive');
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('dot does not have interactive class when disableCollapse is true', async () => {
|
|
101
|
+
const element = createTestComponent({disableCollapse: true});
|
|
102
|
+
await flushPromises();
|
|
103
|
+
|
|
104
|
+
const dot = element.shadowRoot.querySelector(selectors.dot);
|
|
105
|
+
expect(dot.className).not.toContain('thread-item__dot--interactive');
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('line column has interactive class when collapse is enabled and line is visible', async () => {
|
|
109
|
+
const element = createTestComponent();
|
|
110
|
+
await flushPromises();
|
|
111
|
+
|
|
112
|
+
const lineColumn = element.shadowRoot.querySelector(selectors.lineColumn);
|
|
113
|
+
expect(lineColumn.className).toContain(
|
|
114
|
+
'thread-item__line-column--interactive'
|
|
115
|
+
);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('line column does not have interactive class when disableCollapse is true', async () => {
|
|
119
|
+
const element = createTestComponent({disableCollapse: true});
|
|
120
|
+
await flushPromises();
|
|
121
|
+
|
|
122
|
+
const lineColumn = element.shadowRoot.querySelector(selectors.lineColumn);
|
|
123
|
+
expect(lineColumn.className).not.toContain(
|
|
124
|
+
'thread-item__line-column--interactive'
|
|
125
|
+
);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('line column does not have interactive class when hideLine is true', async () => {
|
|
129
|
+
const element = createTestComponent({hideLine: true});
|
|
130
|
+
await flushPromises();
|
|
131
|
+
|
|
132
|
+
const lineColumn = element.shadowRoot.querySelector(selectors.lineColumn);
|
|
133
|
+
expect(lineColumn.className).not.toContain(
|
|
134
|
+
'thread-item__line-column--interactive'
|
|
135
|
+
);
|
|
136
|
+
});
|
|
90
137
|
});
|
|
91
138
|
|
|
92
139
|
describe('expanded state', () => {
|
|
@@ -143,6 +190,97 @@ describe('c-quantic-thread-item', () => {
|
|
|
143
190
|
);
|
|
144
191
|
expect(content).toBeNull();
|
|
145
192
|
});
|
|
193
|
+
|
|
194
|
+
it('expands the content when the dot is clicked while collapsed', async () => {
|
|
195
|
+
const element = createTestComponent();
|
|
196
|
+
await flushPromises();
|
|
197
|
+
|
|
198
|
+
element.shadowRoot.querySelector(selectors.dot).click();
|
|
199
|
+
await flushPromises();
|
|
200
|
+
|
|
201
|
+
const content = element.shadowRoot.querySelector(
|
|
202
|
+
selectors.visibleContent
|
|
203
|
+
);
|
|
204
|
+
expect(content).not.toBeNull();
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it('collapses the content when the dot is clicked while expanded', async () => {
|
|
208
|
+
const element = createTestComponent({isExpanded: true});
|
|
209
|
+
await flushPromises();
|
|
210
|
+
|
|
211
|
+
element.shadowRoot.querySelector(selectors.dot).click();
|
|
212
|
+
await flushPromises();
|
|
213
|
+
|
|
214
|
+
const content = element.shadowRoot.querySelector(
|
|
215
|
+
selectors.visibleContent
|
|
216
|
+
);
|
|
217
|
+
expect(content).toBeNull();
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('does not toggle when the dot is clicked and disableCollapse is true', async () => {
|
|
221
|
+
const element = createTestComponent({disableCollapse: true});
|
|
222
|
+
await flushPromises();
|
|
223
|
+
|
|
224
|
+
element.shadowRoot.querySelector(selectors.dot).click();
|
|
225
|
+
await flushPromises();
|
|
226
|
+
|
|
227
|
+
const content = element.shadowRoot.querySelector(
|
|
228
|
+
selectors.visibleContent
|
|
229
|
+
);
|
|
230
|
+
expect(content).not.toBeNull();
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it('expands the content when the line column is clicked while collapsed', async () => {
|
|
234
|
+
const element = createTestComponent();
|
|
235
|
+
await flushPromises();
|
|
236
|
+
|
|
237
|
+
element.shadowRoot.querySelector(selectors.lineColumn).click();
|
|
238
|
+
await flushPromises();
|
|
239
|
+
|
|
240
|
+
const content = element.shadowRoot.querySelector(
|
|
241
|
+
selectors.visibleContent
|
|
242
|
+
);
|
|
243
|
+
expect(content).not.toBeNull();
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it('collapses the content when the line column is clicked while expanded', async () => {
|
|
247
|
+
const element = createTestComponent({isExpanded: true});
|
|
248
|
+
await flushPromises();
|
|
249
|
+
|
|
250
|
+
element.shadowRoot.querySelector(selectors.lineColumn).click();
|
|
251
|
+
await flushPromises();
|
|
252
|
+
|
|
253
|
+
const content = element.shadowRoot.querySelector(
|
|
254
|
+
selectors.visibleContent
|
|
255
|
+
);
|
|
256
|
+
expect(content).toBeNull();
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
it('does not toggle when the line column is clicked and disableCollapse is true', async () => {
|
|
260
|
+
const element = createTestComponent({disableCollapse: true});
|
|
261
|
+
await flushPromises();
|
|
262
|
+
|
|
263
|
+
element.shadowRoot.querySelector(selectors.lineColumn).click();
|
|
264
|
+
await flushPromises();
|
|
265
|
+
|
|
266
|
+
const content = element.shadowRoot.querySelector(
|
|
267
|
+
selectors.visibleContent
|
|
268
|
+
);
|
|
269
|
+
expect(content).not.toBeNull();
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it('does not toggle when the line column is clicked and hideLine is true', async () => {
|
|
273
|
+
const element = createTestComponent({hideLine: true, isExpanded: true});
|
|
274
|
+
await flushPromises();
|
|
275
|
+
|
|
276
|
+
element.shadowRoot.querySelector(selectors.lineColumn).click();
|
|
277
|
+
await flushPromises();
|
|
278
|
+
|
|
279
|
+
const content = element.shadowRoot.querySelector(
|
|
280
|
+
selectors.visibleContent
|
|
281
|
+
);
|
|
282
|
+
expect(content).not.toBeNull();
|
|
283
|
+
});
|
|
146
284
|
});
|
|
147
285
|
|
|
148
286
|
describe('disableCollapse', () => {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
flex: 1;
|
|
26
26
|
width: 1px;
|
|
27
27
|
background-color: var(--lwc-colorBorder, #dddbda);
|
|
28
|
+
transition: background-color 0.2s ease;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
.thread-item__line::before,
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
width: 1px;
|
|
36
37
|
height: 8px;
|
|
37
38
|
background-color: var(--lwc-colorBorder, #dddbda);
|
|
39
|
+
transition: background-color 0.2s ease;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
.thread-item__line::before {
|
|
@@ -45,6 +47,16 @@
|
|
|
45
47
|
bottom: -8px;
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
.thread-item__line-column--interactive {
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.thread-item__line-column--interactive:hover .thread-item__line,
|
|
55
|
+
.thread-item__line-column--interactive:hover .thread-item__line::before,
|
|
56
|
+
.thread-item__line-column--interactive:hover .thread-item__line::after {
|
|
57
|
+
background-color: var(--lwc-colorTextDefault, #080707);
|
|
58
|
+
}
|
|
59
|
+
|
|
48
60
|
.thread-item__content {
|
|
49
61
|
grid-column: 2;
|
|
50
62
|
grid-row: 2;
|
|
@@ -55,6 +67,15 @@
|
|
|
55
67
|
width: 8px;
|
|
56
68
|
border-radius: 50%;
|
|
57
69
|
background-color: var(--lwc-colorBorder, #dddbda);
|
|
70
|
+
transition: background-color 0.2s ease;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.thread-item__dot--interactive {
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.thread-item__dot--interactive:hover {
|
|
78
|
+
background-color: var(--lwc-colorTextDefault, #080707);
|
|
58
79
|
}
|
|
59
80
|
|
|
60
81
|
.thread-item__dot--expanded {
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<li class="thread-item">
|
|
3
3
|
<div class="thread-item__grid">
|
|
4
|
-
<div
|
|
4
|
+
<div
|
|
5
|
+
class={lineColumnClass}
|
|
6
|
+
data-testid="thread-item-line-column"
|
|
7
|
+
onclick={handleLineClick}
|
|
8
|
+
>
|
|
5
9
|
<div
|
|
6
10
|
class="slds-grid slds-grid_align-center slds-grid_vertical-align-center thread-item__dot-column"
|
|
7
11
|
>
|
|
8
|
-
<span
|
|
12
|
+
<span
|
|
13
|
+
class={dotClass}
|
|
14
|
+
data-testid="thread-item-dot"
|
|
15
|
+
onclick={handleDotClick}
|
|
16
|
+
></span>
|
|
9
17
|
</div>
|
|
10
18
|
<template lwc:if={shouldDisplayLine}>
|
|
11
19
|
<span class="thread-item__line" data-testid="thread-item-line"></span>
|
|
@@ -58,6 +58,21 @@ export default class QuanticThreadItem extends LightningElement {
|
|
|
58
58
|
this._isExpanded = !this._isExpanded;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
handleDotClick(event) {
|
|
62
|
+
event.stopPropagation();
|
|
63
|
+
if (this.disableCollapse) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this._isExpanded = !this._isExpanded;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
handleLineClick() {
|
|
70
|
+
if (this.disableCollapse || this.hideLine) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this._isExpanded = !this._isExpanded;
|
|
74
|
+
}
|
|
75
|
+
|
|
61
76
|
get shouldDisplayLine() {
|
|
62
77
|
return !this.hideLine;
|
|
63
78
|
}
|
|
@@ -75,6 +90,28 @@ export default class QuanticThreadItem extends LightningElement {
|
|
|
75
90
|
}
|
|
76
91
|
|
|
77
92
|
get dotClass() {
|
|
78
|
-
|
|
93
|
+
const classes = ['thread-item__dot'];
|
|
94
|
+
if (this._isExpanded) {
|
|
95
|
+
classes.push('thread-item__dot--expanded');
|
|
96
|
+
}
|
|
97
|
+
if (!this.disableCollapse) {
|
|
98
|
+
classes.push('thread-item__dot--interactive');
|
|
99
|
+
}
|
|
100
|
+
return classes.join(' ');
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
get lineColumnClass() {
|
|
104
|
+
const classes = [
|
|
105
|
+
'slds-grid',
|
|
106
|
+
'slds-grid_align-center',
|
|
107
|
+
'slds-grid_vertical',
|
|
108
|
+
'slds-grid_vertical-align-center',
|
|
109
|
+
'slds-shrink-none',
|
|
110
|
+
'thread-item__timeline',
|
|
111
|
+
];
|
|
112
|
+
if (!this.disableCollapse && !this.hideLine) {
|
|
113
|
+
classes.push('thread-item__line-column--interactive');
|
|
114
|
+
}
|
|
115
|
+
return classes.join(' ');
|
|
79
116
|
}
|
|
80
117
|
}
|