@coveo/quantic 3.37.5 → 3.37.7
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/quanticResultLink/__tests__/quanticResultLink.test.js +42 -1
- package/force-app/main/default/lwc/quanticResultLink/quanticResultLink.html +1 -1
- package/force-app/main/default/lwc/quanticResultLink/quanticResultLink.js +4 -10
- package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +4 -10
- package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +8 -11
- package/force-app/main/default/staticresources/coveobueno/browser/bueno.js +5 -0
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +19 -18
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/compare-utils.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/headless.js +19 -18
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +19 -18
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +17 -16
- package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
- package/package.json +7 -7
|
@@ -101,7 +101,7 @@ describe('c-quantic-result-link', () => {
|
|
|
101
101
|
);
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
it('should open the result link in a Salesforce console subtab', async () => {
|
|
104
|
+
it('should open the result link in a Salesforce console subtab when no target is specified', async () => {
|
|
105
105
|
const element = createTestComponent({result: exampleSalesforceResult});
|
|
106
106
|
await flushPromises();
|
|
107
107
|
|
|
@@ -115,6 +115,34 @@ describe('c-quantic-result-link', () => {
|
|
|
115
115
|
);
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
+
it('should open the Salesforce result link in a new browser tab when target is _blank', async () => {
|
|
119
|
+
const element = createTestComponent({
|
|
120
|
+
result: exampleSalesforceResult,
|
|
121
|
+
target: '_blank',
|
|
122
|
+
});
|
|
123
|
+
await flushPromises();
|
|
124
|
+
|
|
125
|
+
const linkSalesforce = element.shadowRoot.querySelector('a');
|
|
126
|
+
linkSalesforce.click();
|
|
127
|
+
|
|
128
|
+
expect(linkSalesforce.getAttribute('target')).toEqual('_blank');
|
|
129
|
+
expect(getNavigateCalledWith().pageReference).toBeUndefined();
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('should let Salesforce result links use other target values without console navigation', async () => {
|
|
133
|
+
const element = createTestComponent({
|
|
134
|
+
result: exampleSalesforceResult,
|
|
135
|
+
target: '_parent',
|
|
136
|
+
});
|
|
137
|
+
await flushPromises();
|
|
138
|
+
|
|
139
|
+
const linkSalesforce = element.shadowRoot.querySelector('a');
|
|
140
|
+
linkSalesforce.click();
|
|
141
|
+
|
|
142
|
+
expect(linkSalesforce.getAttribute('target')).toEqual('_parent');
|
|
143
|
+
expect(getNavigateCalledWith().pageReference).toBeUndefined();
|
|
144
|
+
});
|
|
145
|
+
|
|
118
146
|
describe('when the result is a knowledge article', () => {
|
|
119
147
|
const exampleKnowledgeArticleResult = {
|
|
120
148
|
...exampleResult,
|
|
@@ -176,6 +204,19 @@ describe('c-quantic-result-link', () => {
|
|
|
176
204
|
expect(link.getAttribute('target')).toEqual('_self');
|
|
177
205
|
});
|
|
178
206
|
|
|
207
|
+
it('should open the result link in a new tab when target is _blank', async () => {
|
|
208
|
+
const element = createTestComponent({
|
|
209
|
+
result: exampleResult,
|
|
210
|
+
target: '_blank',
|
|
211
|
+
});
|
|
212
|
+
await flushPromises();
|
|
213
|
+
|
|
214
|
+
const link = element.shadowRoot.querySelector('a');
|
|
215
|
+
|
|
216
|
+
expect(link.getAttribute('href')).toEqual(exampleResult.clickUri);
|
|
217
|
+
expect(link.getAttribute('target')).toEqual('_blank');
|
|
218
|
+
});
|
|
219
|
+
|
|
179
220
|
describe('with a custom value for the target property', () => {
|
|
180
221
|
it('should open the result link based on the value of the target property', async () => {
|
|
181
222
|
const customTarget = '_blank';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a href={hrefValue} aria-label={ariaLabelValue} target={
|
|
2
|
+
<a href={hrefValue} aria-label={ariaLabelValue} target={target} onclick={handleClick} tabindex="0" role="link">
|
|
3
3
|
<c-quantic-result-highlighted-text-field engine-id={engineId} result={result} field={fieldToDisplay}></c-quantic-result-highlighted-text-field>
|
|
4
4
|
</a>
|
|
5
5
|
</template>
|
|
@@ -121,7 +121,7 @@ export default class QuanticResultLink extends NavigationMixin(
|
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
handleClick(event) {
|
|
124
|
-
if (this.
|
|
124
|
+
if (this.shouldNavigateToSalesforceRecord) {
|
|
125
125
|
event.preventDefault();
|
|
126
126
|
this.navigateToSalesforceRecord(event);
|
|
127
127
|
}
|
|
@@ -175,21 +175,15 @@ export default class QuanticResultLink extends NavigationMixin(
|
|
|
175
175
|
: 'clickUri';
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
*/
|
|
181
|
-
get targetTab() {
|
|
182
|
-
if (this.isSalesforceLink) {
|
|
183
|
-
return '_blank';
|
|
184
|
-
}
|
|
185
|
-
return this.target;
|
|
178
|
+
get shouldNavigateToSalesforceRecord() {
|
|
179
|
+
return this.isSalesforceLink && this.target === '_self';
|
|
186
180
|
}
|
|
187
181
|
|
|
188
182
|
/**
|
|
189
183
|
* Returns the aria label value for the link.
|
|
190
184
|
*/
|
|
191
185
|
get ariaLabelValue() {
|
|
192
|
-
if (this.
|
|
186
|
+
if (this.shouldNavigateToSalesforceRecord) {
|
|
193
187
|
return this.labels.navigateToRecord;
|
|
194
188
|
}
|
|
195
189
|
return this.labels.opensInBrowserTab;
|
|
@@ -10,10 +10,6 @@ export class SortObject {
|
|
|
10
10
|
return this.page.getByRole('combobox', {name: 'Sort by'});
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
get sortPreviewButton(): Locator {
|
|
14
|
-
return this.page.getByRole('button', {name: 'Preview'});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
13
|
sortButton(buttonName: string): Locator {
|
|
18
14
|
return this.page.getByRole('option', {name: buttonName});
|
|
19
15
|
}
|
|
@@ -23,8 +19,7 @@ export class SortObject {
|
|
|
23
19
|
}
|
|
24
20
|
|
|
25
21
|
async focusSortDropDown(): Promise<void> {
|
|
26
|
-
await this.
|
|
27
|
-
await this.page.keyboard.press('Tab');
|
|
22
|
+
await this.sortDropDown.focus();
|
|
28
23
|
}
|
|
29
24
|
|
|
30
25
|
async clickSortButton(buttonName: string): Promise<void> {
|
|
@@ -33,12 +28,11 @@ export class SortObject {
|
|
|
33
28
|
|
|
34
29
|
async openSortDropdownUsingKeyboardEnter(useEnter = true): Promise<void> {
|
|
35
30
|
if (useEnter) {
|
|
36
|
-
await this.
|
|
31
|
+
await this.sortDropDown.press('Enter');
|
|
37
32
|
} else {
|
|
38
|
-
await this.
|
|
33
|
+
await this.sortDropDown.press('Space');
|
|
39
34
|
}
|
|
40
|
-
await this.sortButton('Oldest').
|
|
41
|
-
await this.page.waitForTimeout(500);
|
|
35
|
+
await this.sortButton('Oldest').waitFor({state: 'visible'});
|
|
42
36
|
}
|
|
43
37
|
|
|
44
38
|
async waitForSortUaAnalytics(eventValue: any): Promise<Request> {
|
|
@@ -47,25 +47,22 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
test.describe('when testing accessibility', () => {
|
|
50
|
-
test('should be accessible to keyboard', async ({sort
|
|
51
|
-
|
|
52
|
-
expect(selectedSortLabel).toEqual(sortArrOptions[0]);
|
|
50
|
+
test('should be accessible to keyboard', async ({sort}) => {
|
|
51
|
+
await expect(sort.sortDropDown).toHaveText(sortArrOptions[0]);
|
|
53
52
|
|
|
54
53
|
// Selecting the next sort using Enter to open dropdown, the ArrowDown, then ENTER key
|
|
55
54
|
await sort.focusSortDropDown();
|
|
56
55
|
await sort.openSortDropdownUsingKeyboardEnter();
|
|
57
|
-
await
|
|
58
|
-
await
|
|
59
|
-
|
|
60
|
-
expect(selectedSortLabel).toEqual(sortArrOptions[1]);
|
|
56
|
+
await sort.sortDropDown.press('ArrowDown');
|
|
57
|
+
await sort.sortDropDown.press('Enter');
|
|
58
|
+
await expect(sort.sortDropDown).toHaveText(sortArrOptions[1]);
|
|
61
59
|
|
|
62
60
|
// Selecting the next sort using Space to open dropdown, the ArrowDown, then ENTER key
|
|
63
61
|
await sort.focusSortDropDown();
|
|
64
62
|
await sort.openSortDropdownUsingKeyboardEnter(false);
|
|
65
|
-
await
|
|
66
|
-
await
|
|
67
|
-
|
|
68
|
-
expect(selectedSortLabel).toEqual(sortArrOptions[2]);
|
|
63
|
+
await sort.sortDropDown.press('ArrowDown');
|
|
64
|
+
await sort.sortDropDown.press('Enter');
|
|
65
|
+
await expect(sort.sortDropDown).toHaveText(sortArrOptions[2]);
|
|
69
66
|
});
|
|
70
67
|
});
|
|
71
68
|
|
|
@@ -80,6 +80,7 @@ var Schema = class {
|
|
|
80
80
|
constructor(definition) {
|
|
81
81
|
this.definition = definition;
|
|
82
82
|
}
|
|
83
|
+
definition;
|
|
83
84
|
validate(values = {}, message = "") {
|
|
84
85
|
const mergedValues = {
|
|
85
86
|
...this.default,
|
|
@@ -112,6 +113,7 @@ var Value = class {
|
|
|
112
113
|
constructor(baseConfig = {}) {
|
|
113
114
|
this.baseConfig = baseConfig;
|
|
114
115
|
}
|
|
116
|
+
baseConfig;
|
|
115
117
|
validate(value) {
|
|
116
118
|
if (this.baseConfig.required && isNullOrUndefined(value)) {
|
|
117
119
|
return "value is required.";
|
|
@@ -171,6 +173,7 @@ var NumberValue = class {
|
|
|
171
173
|
this.config = config;
|
|
172
174
|
this.value = new Value(config);
|
|
173
175
|
}
|
|
176
|
+
config;
|
|
174
177
|
value;
|
|
175
178
|
validate(value) {
|
|
176
179
|
const valueValidation = this.value.validate(value);
|
|
@@ -307,6 +310,7 @@ var ArrayValue = class {
|
|
|
307
310
|
this.config = config;
|
|
308
311
|
this.value = new Value(this.config);
|
|
309
312
|
}
|
|
313
|
+
config;
|
|
310
314
|
value;
|
|
311
315
|
validate(input) {
|
|
312
316
|
if (!isNullOrUndefined(input) && !Array.isArray(input)) {
|
|
@@ -369,6 +373,7 @@ var EnumValue = class {
|
|
|
369
373
|
this.config = config;
|
|
370
374
|
this.value = new Value(config);
|
|
371
375
|
}
|
|
376
|
+
config;
|
|
372
377
|
value;
|
|
373
378
|
validate(value) {
|
|
374
379
|
const invalid = this.value.validate(value);
|