Skip to content

Commit e392c77

Browse files
authored
fix(quantic): optimized the loading of the bueno script in quantic (#6630)
1 parent 173bb38 commit e392c77

File tree

3 files changed

+10
-30
lines changed

3 files changed

+10
-30
lines changed

packages/quantic/coveo.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ declare global {
5656
bundle: AnyHeadless;
5757
};
5858
};
59-
coveoQuanticVersion: string
59+
coveoQuanticVersion: string;
60+
Bueno?: typeof BuenoTypes;
6061
}
6162
}
6263

packages/quantic/force-app/main/default/lwc/quanticHeadlessLoader/quanticHeadlessLoader.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ const headlessBundles = {
5353
/**
5454
* Loads the Bueno library dependency.
5555
* @param element The Lightning element to use to load dependencies.
56-
* @returns {Promise<Bueno>}
56+
* @returns {Promise}
5757
*/
5858
const getBueno = (element) => {
59+
if (window.Bueno) {
60+
return Promise.resolve();
61+
}
5962
return loadScript(element, BuenoPath + '/browser/bueno.js');
6063
};
6164

packages/quantic/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,7 @@ useCaseTestCases.forEach((useCase) => {
8383
test.describe('when opening the feedback modal and providing feedback', () => {
8484
test('should send the smart snippet reason analytics events', async ({
8585
smartSnippet,
86-
}, testInfo) => {
87-
// Todo - remove .skip when the feedback modal of Smart Snippet opens in SF with LWS disabled (SFINT-6407)
88-
test.skip(
89-
testInfo.project.name === 'LWS-disabled',
90-
'Feedback modal not available when LWS is disabled (SFINT-6407)'
91-
);
92-
86+
}) => {
9387
const expectedReason = 'does_not_answer';
9488

9589
const openFeedbackModalAnalyticsPromise =
@@ -110,13 +104,7 @@ useCaseTestCases.forEach((useCase) => {
110104
test.describe('when closing the feedback modal', () => {
111105
test('should send the correct close feedback modal analytics event', async ({
112106
smartSnippet,
113-
}, testInfo) => {
114-
// Todo - remove .skip when the feedback modal of Smart Snippet opens in SF with LWS disabled (SFINT-6407)
115-
test.skip(
116-
testInfo.project.name === 'LWS-disabled',
117-
'Feedback modal not available when LWS is disabled (SFINT-6407)'
118-
);
119-
107+
}) => {
120108
await smartSnippet.clickDislikeButton();
121109
await smartSnippet.clickExplainWhyButton();
122110
const closeFeedbackModalAnalyticsPromise =
@@ -131,13 +119,7 @@ useCaseTestCases.forEach((useCase) => {
131119
test('should not allow to open the feedback modal', async ({
132120
smartSnippet,
133121
search,
134-
}, testInfo) => {
135-
// Todo - remove .skip when the feedback modal of Smart Snippet opens in SF with LWS disabled (SFINT-6407)
136-
test.skip(
137-
testInfo.project.name === 'LWS-disabled',
138-
'Feedback modal not available when LWS is disabled (SFINT-6407)'
139-
);
140-
122+
}) => {
141123
await smartSnippet.clickDislikeButton();
142124
await smartSnippet.clickExplainWhyButton();
143125
await smartSnippet.selectFirstFeedbackOptionLabel();
@@ -159,13 +141,7 @@ useCaseTestCases.forEach((useCase) => {
159141
test('should allow to open the feedback modal', async ({
160142
smartSnippet,
161143
search,
162-
}, testInfo) => {
163-
// Todo - remove .skip when the feedback modal of Smart Snippet opens in SF with LWS disabled (SFINT-6407)
164-
test.skip(
165-
testInfo.project.name === 'LWS-disabled',
166-
'Feedback modal not available when LWS is disabled (SFINT-6407)'
167-
);
168-
144+
}) => {
169145
await smartSnippet.clickDislikeButton();
170146
await smartSnippet.clickExplainWhyButton();
171147
await smartSnippet.selectFirstFeedbackOptionLabel();

0 commit comments

Comments
 (0)