coveo.analytics 2.26.4 → 2.26.6
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/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +68 -4
- package/dist/coveoua.debug.js.map +1 -1
- package/dist/coveoua.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/client/analytics.d.ts +1 -0
- package/dist/definitions/insight/insightClient.d.ts +14 -1
- package/dist/definitions/version.d.ts +1 -1
- package/dist/library.es.js +68 -4
- package/dist/library.js +68 -4
- package/dist/react-native.es.js +68 -4
- package/package.json +1 -1
- package/src/caseAssist/caseAssistClient.spec.ts +4 -4
- package/src/client/analytics.spec.ts +36 -1
- package/src/client/analytics.ts +27 -3
- package/src/coveoua/simpleanalytics.spec.ts +43 -17
- package/src/donottrack.spec.ts +4 -4
- package/src/insight/insightClient.spec.ts +274 -6
- package/src/insight/insightClient.ts +134 -0
- package/src/searchPage/searchPageClient.spec.ts +9 -10
|
@@ -3,13 +3,12 @@ import {
|
|
|
3
3
|
SearchPageEvents,
|
|
4
4
|
PartialDocumentInformation,
|
|
5
5
|
CustomEventsTypes,
|
|
6
|
-
SmartSnippetFeedbackReason,
|
|
7
6
|
OmniboxSuggestionsMetadata,
|
|
8
7
|
StaticFilterToggleValueMetadata,
|
|
9
8
|
} from './searchPageEvents';
|
|
10
9
|
import CoveoAnalyticsClient from '../client/analytics';
|
|
11
10
|
import {NoopAnalytics} from '../client/noopAnalytics';
|
|
12
|
-
import {mockFetch} from '../../tests/fetchMock';
|
|
11
|
+
import {mockFetch, lastCallBody} from '../../tests/fetchMock';
|
|
13
12
|
import doNotTrack from '../donottrack';
|
|
14
13
|
jest.mock('../donottrack', () => {
|
|
15
14
|
return {
|
|
@@ -114,9 +113,9 @@ describe('SearchPageClient', () => {
|
|
|
114
113
|
});
|
|
115
114
|
|
|
116
115
|
const expectMatchPayload = (actionCause: SearchPageEvents, meta = {}) => {
|
|
117
|
-
const
|
|
116
|
+
const body: string = lastCallBody(fetchMock);
|
|
118
117
|
const customData = {foo: 'bar', ...customDataFromMiddleware, ...meta};
|
|
119
|
-
expect(JSON.parse(body
|
|
118
|
+
expect(JSON.parse(body)).toEqual({
|
|
120
119
|
queryText: 'queryText',
|
|
121
120
|
responseTime: 123,
|
|
122
121
|
searchQueryUid: provider.getSearchUID(),
|
|
@@ -142,9 +141,9 @@ describe('SearchPageClient', () => {
|
|
|
142
141
|
};
|
|
143
142
|
|
|
144
143
|
const expectMatchDocumentPayload = (actionCause: SearchPageEvents, doc: PartialDocumentInformation, meta = {}) => {
|
|
145
|
-
const
|
|
144
|
+
const body: string = lastCallBody(fetchMock);
|
|
146
145
|
const customData = {foo: 'bar', ...customDataFromMiddleware, ...meta};
|
|
147
|
-
expect(JSON.parse(body
|
|
146
|
+
expect(JSON.parse(body)).toEqual({
|
|
148
147
|
anonymous: false,
|
|
149
148
|
actionCause,
|
|
150
149
|
customData,
|
|
@@ -164,9 +163,9 @@ describe('SearchPageClient', () => {
|
|
|
164
163
|
meta = {},
|
|
165
164
|
eventType = CustomEventsTypes[actionCause]
|
|
166
165
|
) => {
|
|
167
|
-
const
|
|
166
|
+
const body: string = lastCallBody(fetchMock);
|
|
168
167
|
const customData = {foo: 'bar', ...customDataFromMiddleware, ...meta};
|
|
169
|
-
expect(JSON.parse(body
|
|
168
|
+
expect(JSON.parse(body)).toEqual({
|
|
170
169
|
anonymous: false,
|
|
171
170
|
eventValue: actionCause,
|
|
172
171
|
eventType,
|
|
@@ -182,9 +181,9 @@ describe('SearchPageClient', () => {
|
|
|
182
181
|
};
|
|
183
182
|
|
|
184
183
|
const expectMatchCustomEventWithTypePayload = (eventValue: string, eventType: string, meta = {}) => {
|
|
185
|
-
const
|
|
184
|
+
const body: string = lastCallBody(fetchMock);
|
|
186
185
|
const customData = {foo: 'bar', ...customDataFromMiddleware, ...meta};
|
|
187
|
-
expect(JSON.parse(body
|
|
186
|
+
expect(JSON.parse(body)).toEqual({
|
|
188
187
|
anonymous: false,
|
|
189
188
|
eventValue,
|
|
190
189
|
eventType,
|