@coveo/quantic 3.16.0 → 3.16.1-pre.9c01cf606f

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/staticresources/coveoheadless/case-assist/headless.js +2 -2
  2. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/recent-queries-list/headless-recent-queries-list.d.ts +5 -0
  3. package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recent-queries-list/headless-recent-queries-list.d.ts +5 -0
  4. package/force-app/main/default/staticresources/coveoheadless/headless.js +10 -10
  5. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +2 -2
  6. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +2 -2
  7. package/package.json +5 -3
  8. package/force-app/main/default/lwc/quanticBreadcrumbManager/__tests__/quanticBreadcrumbManager.test.js +0 -604
  9. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +0 -76
  10. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/pageObject.ts +0 -282
  11. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +0 -167
  12. package/force-app/main/default/lwc/quanticCarousel/__tests__/quanticCarousel.test.js +0 -262
  13. package/force-app/main/default/lwc/quanticCaseClassification/__tests__/quanticCaseClassification.test.js +0 -819
  14. package/force-app/main/default/lwc/quanticCaseClassification/e2e/data.ts +0 -23
  15. package/force-app/main/default/lwc/quanticCaseClassification/e2e/fixture.ts +0 -51
  16. package/force-app/main/default/lwc/quanticCaseClassification/e2e/pageObject.ts +0 -152
  17. package/force-app/main/default/lwc/quanticCaseClassification/e2e/quanticCaseClassification.e2e.ts +0 -269
  18. package/force-app/main/default/lwc/quanticCategoryFacet/__tests__/quanticCategoryFacet.test.js +0 -327
  19. package/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js +0 -269
  20. package/force-app/main/default/lwc/quanticColoredResultBadge/__tests__/quanticColoredResultBadge.test.js +0 -212
  21. package/force-app/main/default/lwc/quanticDateFacet/__tests__/quanticDateFacet.test.js +0 -321
  22. package/force-app/main/default/lwc/quanticDidYouMean/__tests__/quanticDidYouMean.test.js +0 -199
  23. package/force-app/main/default/lwc/quanticFacet/__tests__/quanticFacet.test.js +0 -341
  24. package/force-app/main/default/lwc/quanticFacetCaption/__tests__/quanticFacetCaption.test.js +0 -28
  25. package/force-app/main/default/lwc/quanticFacetManager/__tests__/quanticFacetManager.test.js +0 -178
  26. package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +0 -63
  27. package/force-app/main/default/lwc/quanticFacetManager/e2e/pageObject.ts +0 -23
  28. package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +0 -82
  29. package/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js +0 -392
  30. package/force-app/main/default/lwc/quanticFeedbackModal/__tests__/quanticFeedbackModal.test.js +0 -448
  31. package/force-app/main/default/lwc/quanticFeedbackModalQna/__tests__/quanticFeedbackModalQna.test.js +0 -298
  32. package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +0 -814
  33. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/data.ts +0 -56
  34. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture.ts +0 -87
  35. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +0 -283
  36. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswer.e2e.ts +0 -199
  37. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/__tests__/quanticGeneratedAnswerContent.test.js +0 -151
  38. package/force-app/main/default/lwc/quanticHeading/__tests__/quanticHeading.test.js +0 -71
  39. package/force-app/main/default/lwc/quanticHeadlessLoader/__tests__/quanticHeadlessLoader.test.js +0 -651
  40. package/force-app/main/default/lwc/quanticNotifications/__tests__/quanticNotifications.test.js +0 -335
  41. package/force-app/main/default/lwc/quanticNumericFacet/__tests__/quanticNumericFacet.test.js +0 -343
  42. package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +0 -63
  43. package/force-app/main/default/lwc/quanticPager/e2e/pageObject.ts +0 -69
  44. package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +0 -101
  45. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/defaultTestCase.json +0 -13
  46. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/youtubeTestCase.json +0 -14
  47. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js +0 -82
  48. package/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js +0 -273
  49. package/force-app/main/default/lwc/quanticRefineModalContent/__tests__/quanticRefineModalContent.test.js +0 -501
  50. package/force-app/main/default/lwc/quanticResultAction/__tests__/quanticResultAction.test.js +0 -262
  51. package/force-app/main/default/lwc/quanticResultActionBar/__tests__/quanticResultActionBar.test.js +0 -141
  52. package/force-app/main/default/lwc/quanticResultChildren/__tests__/quanticResultChildren.test.js +0 -340
  53. package/force-app/main/default/lwc/quanticResultDate/__tests__/quanticResultDate.test.js +0 -144
  54. package/force-app/main/default/lwc/quanticResultField/__tests__/quanticResultField.test.js +0 -120
  55. package/force-app/main/default/lwc/quanticResultHighlightedTextField/__tests__/quanticResultHighlightedTextField.test.js +0 -209
  56. package/force-app/main/default/lwc/quanticResultLink/__tests__/quanticResultLink.test.js +0 -261
  57. package/force-app/main/default/lwc/quanticResultMultiValueText/__tests__/quanticResultMultiValueText.test.js +0 -235
  58. package/force-app/main/default/lwc/quanticResultNumber/__tests__/quanticResultNumber.test.js +0 -144
  59. package/force-app/main/default/lwc/quanticResultPrintableUri/__tests__/quanticResultPrintableUri.test.js +0 -324
  60. package/force-app/main/default/lwc/quanticResultQuickview/__tests__/quanticResultQuickview.test.js +0 -171
  61. package/force-app/main/default/lwc/quanticResultText/__tests__/quanticResultText.test.js +0 -155
  62. package/force-app/main/default/lwc/quanticResultsPerPage/__tests__/quanticResultsPerPage.test.js +0 -404
  63. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/fixture.ts +0 -74
  64. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/pageObject.ts +0 -85
  65. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/quanticResultsPerPage.e2e.ts +0 -97
  66. package/force-app/main/default/lwc/quanticSearchBox/__tests__/quanticSearchBox.test.js +0 -168
  67. package/force-app/main/default/lwc/quanticSearchBoxInput/__tests__/quanticSearchBoxInput.test.js +0 -823
  68. package/force-app/main/default/lwc/quanticSmartSnippet/__tests__/quanticSmartSnippet.test.js +0 -341
  69. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/data.ts +0 -21
  70. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/fixture.ts +0 -91
  71. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/pageObject.ts +0 -196
  72. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts +0 -168
  73. package/force-app/main/default/lwc/quanticSmartSnippetAnswer/__tests__/quanticSmartSnippetAnswer.test.js +0 -126
  74. package/force-app/main/default/lwc/quanticSmartSnippetSource/__tests__/quanticSmartSnippetSource.test.js +0 -290
  75. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/__tests__/quanticSmartSnippetSuggestions.test.js +0 -329
  76. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/data.ts +0 -31
  77. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/fixture.ts +0 -93
  78. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/pageObject.ts +0 -160
  79. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/quanticSmartSnippetSuggestions.e2e.ts +0 -127
  80. package/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js +0 -416
  81. package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +0 -61
  82. package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +0 -89
  83. package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +0 -91
  84. package/force-app/main/default/lwc/quanticSourceCitations/__tests__/quanticSourceCitations.test.js +0 -123
  85. package/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js +0 -186
  86. package/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js +0 -222
  87. package/force-app/main/default/lwc/quanticTab/__tests__/quanticTab.test.js +0 -287
  88. package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +0 -62
  89. package/force-app/main/default/lwc/quanticTab/e2e/pageObject.ts +0 -67
  90. package/force-app/main/default/lwc/quanticTab/e2e/quanticTab.e2e.ts +0 -77
  91. package/force-app/main/default/lwc/quanticTabBar/__tests__/quanticTabBar.test.js +0 -331
  92. package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +0 -61
  93. package/force-app/main/default/lwc/quanticTabBar/e2e/pageObject.ts +0 -80
  94. package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +0 -173
  95. package/force-app/main/default/lwc/quanticTimeframeFacet/__tests__/quanticTimeframeFacet.test.js +0 -339
  96. package/force-app/main/default/lwc/quanticTooltip/__tests__/quanticTooltip.test.js +0 -107
  97. package/force-app/main/default/lwc/quanticUserAction/__tests__/quanticUserAction.test.js +0 -427
  98. package/force-app/main/default/lwc/quanticUserActionsSession/__tests__/quanticUserActionsSession.test.js +0 -269
  99. package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/data/userActionsState.json +0 -89
  100. package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/quanticUserActionsTimeline.test.js +0 -511
  101. package/force-app/main/default/lwc/quanticUserActionsToggle/__tests__/quanticUserActionsToggle.test.js +0 -229
  102. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/data.ts +0 -32
  103. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/fixture.ts +0 -32
  104. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/pageObject.ts +0 -71
  105. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/quanticUserActionsToggle.e2e.ts +0 -39
  106. package/force-app/main/default/lwc/quanticUtils/__tests__/facetDependenciesUtils.test.js +0 -92
  107. package/force-app/main/default/lwc/quanticUtils/__tests__/markdownUtils.test.js +0 -71
  108. package/force-app/main/default/lwc/quanticUtils/__tests__/quanticUtils.test.js +0 -223
  109. package/force-app/main/default/lwc/quanticViewedByCustomerBadge/__tests__/quanticViewedByCustomerBadge.test.js +0 -131
@@ -1,151 +0,0 @@
1
- // @ts-ignore
2
- import QuanticGeneratedAnswerContent from 'c/quanticGeneratedAnswerContent';
3
- import {createElement} from 'lwc';
4
- import {loadMarkdownDependencies} from 'c/quanticUtils';
5
-
6
- jest.mock('c/quanticUtils', () => ({
7
- loadMarkdownDependencies: jest.fn(
8
- () =>
9
- new Promise((resolve) => {
10
- resolve();
11
- })
12
- ),
13
- transformMarkdownToHtml: jest.fn((value) => value),
14
- }));
15
-
16
- const mockMarkedUse = jest.fn();
17
- const mockMarkedParse = jest.fn((text) => text);
18
- global.marked = {
19
- use: mockMarkedUse,
20
- parse: mockMarkedParse,
21
- };
22
-
23
- const SELECTORS = {
24
- textAnswerContainer: 'span.generated-answer-content__answer',
25
- markdownAnswerContainer: 'div.generated-answer-content__answer',
26
- };
27
-
28
- const defaultOptions = {
29
- isStreaming: false,
30
- answerContentFormat: 'text/plain',
31
- answer: '',
32
- };
33
-
34
- function createTestComponent(options = defaultOptions) {
35
- const element = createElement('c-quantic-generated-answer-content', {
36
- is: QuanticGeneratedAnswerContent,
37
- });
38
- for (const [key, value] of Object.entries(options)) {
39
- element[key] = value;
40
- }
41
-
42
- document.body.appendChild(element);
43
- return element;
44
- }
45
-
46
- // Helper function to wait until the microtask queue is empty.
47
- function flushPromises() {
48
- // eslint-disable-next-line @lwc/lwc/no-async-operation
49
- return new Promise((resolve) => setTimeout(resolve, 0));
50
- }
51
-
52
- describe('c-quantic-generated-answer-content', () => {
53
- function cleanup() {
54
- // The jsdom instance is shared across test cases in a single file so reset the DOM
55
- while (document.body.firstChild) {
56
- document.body.removeChild(document.body.firstChild);
57
- }
58
- jest.clearAllMocks();
59
- }
60
-
61
- afterEach(() => {
62
- cleanup();
63
- });
64
-
65
- describe('text/plain answer content', () => {
66
- it('should render a simple text/plain answer when not streaming', async () => {
67
- const element = createTestComponent({
68
- ...defaultOptions,
69
- answer: 'Hello, world!',
70
- });
71
- await flushPromises();
72
-
73
- const answerContent = element.shadowRoot.querySelector(
74
- SELECTORS.textAnswerContainer
75
- );
76
-
77
- expect(answerContent.textContent).toBe('Hello, world!');
78
- expect(answerContent.className).toBe('generated-answer-content__answer');
79
- });
80
-
81
- it('should render a text/plain answer when streaming', async () => {
82
- const element = createTestComponent({
83
- ...defaultOptions,
84
- answer: 'Hello, world!',
85
- isStreaming: true,
86
- });
87
- await flushPromises();
88
-
89
- const answerContent = element.shadowRoot.querySelector(
90
- SELECTORS.textAnswerContainer
91
- );
92
-
93
- expect(answerContent.textContent).toBe('Hello, world!');
94
- expect(answerContent.className).toContain(
95
- 'generated-answer-content__answer--streaming'
96
- );
97
- });
98
- });
99
-
100
- describe('text/markdown answer content', () => {
101
- it('should render a simple markdown answer when not streaming', async () => {
102
- const element = createTestComponent({
103
- ...defaultOptions,
104
- answerContentFormat: 'text/markdown',
105
- answer: 'Hello, world!',
106
- });
107
- await flushPromises();
108
-
109
- const answerContent = element.shadowRoot.querySelector(
110
- SELECTORS.markdownAnswerContainer
111
- );
112
-
113
- expect(answerContent.textContent).toBe('Hello, world!');
114
- expect(answerContent.className).toBe('generated-answer-content__answer');
115
- });
116
-
117
- it('should render a simple markdown answer when streaming', async () => {
118
- const element = createTestComponent({
119
- ...defaultOptions,
120
- answerContentFormat: 'text/markdown',
121
- answer: 'Hello, world!',
122
- isStreaming: true,
123
- });
124
- await flushPromises();
125
-
126
- const answerContent = element.shadowRoot.querySelector(
127
- SELECTORS.markdownAnswerContainer
128
- );
129
-
130
- expect(answerContent.textContent).toBe('Hello, world!');
131
- expect(answerContent.className).toContain(
132
- 'generated-answer-content__answer--streaming'
133
- );
134
- });
135
- });
136
-
137
- describe('the reactivity of the answerContentFormat property', () => {
138
- it('should load the markdown dependencies when the answerContentFormat property is changed to text/markdown', async () => {
139
- const element = createTestComponent({
140
- ...defaultOptions,
141
- answerContentFormat: 'text/plain',
142
- });
143
- await flushPromises();
144
- expect(loadMarkdownDependencies).not.toHaveBeenCalled();
145
-
146
- element.answerContentFormat = 'text/markdown';
147
- await flushPromises();
148
- expect(loadMarkdownDependencies).toHaveBeenCalled();
149
- });
150
- });
151
- });
@@ -1,71 +0,0 @@
1
- // @ts-ignore
2
- import {createElement} from 'lwc';
3
- import QuanticHeading from '../quanticHeading';
4
-
5
- const exampleLabel = 'Example Label';
6
- const exampleLevel = 3;
7
- const selectors = {
8
- label: '[data-section="label"]',
9
- };
10
-
11
- const defaultOptions = {
12
- label: exampleLabel,
13
- level: exampleLevel,
14
- };
15
-
16
- function createTestComponent(options = defaultOptions) {
17
- const element = createElement('c-quantic-heading', {
18
- is: QuanticHeading,
19
- });
20
-
21
- for (const [key, value] of Object.entries(options)) {
22
- element[key] = value;
23
- }
24
-
25
- document.body.appendChild(element);
26
- return element;
27
- }
28
-
29
- // Helper function to wait until the microtask queue is empty.
30
- function flushPromises() {
31
- return new Promise((resolve) => setTimeout(resolve, 0));
32
- }
33
-
34
- describe('c-quantic-heading', () => {
35
- function cleanup() {
36
- // The jsdom instance is shared across test cases in a single file so reset the DOM
37
- while (document.body.firstChild) {
38
- document.body.removeChild(document.body.firstChild);
39
- }
40
- }
41
-
42
- afterEach(() => {
43
- cleanup();
44
- });
45
-
46
- it('should display the label with the right header tag level', async () => {
47
- const expectedTag = `h${exampleLevel}`;
48
- const element = createTestComponent();
49
- await flushPromises();
50
-
51
- const label = element.shadowRoot.querySelector(
52
- `${selectors.label} > ${expectedTag}`
53
- );
54
- expect(label).not.toBeNull();
55
- expect(label.innerText).toBe(exampleLabel);
56
- });
57
-
58
- describe('when an invalid value of the level property is used', () => {
59
- it('should display the label in a "div" tag', async () => {
60
- const expectedTag = 'div';
61
- const element = createTestComponent({...defaultOptions, level: 7});
62
- await flushPromises();
63
-
64
- const label = element.shadowRoot.querySelector(
65
- `${selectors.label} > ${expectedTag}`
66
- );
67
- expect(label).not.toBeNull();
68
- expect(label.innerText).toBe(exampleLabel);
69
- });
70
- });
71
- });