coveo.analytics 2.23.6 → 2.23.8
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 +869 -209
- 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 +18 -5
- package/dist/definitions/client/noopAnalytics.d.ts +7 -2
- package/dist/definitions/events.d.ts +8 -0
- package/dist/definitions/insight/insightClient.d.ts +2 -0
- package/dist/definitions/searchPage/searchPageClient.d.ts +75 -77
- package/dist/definitions/searchPage/searchPageEvents.d.ts +3 -1
- package/dist/library.es.js +374 -142
- package/dist/library.js +869 -209
- package/dist/react-native.es.js +374 -142
- package/package.json +1 -1
- package/src/client/analytics.ts +75 -16
- package/src/client/noopAnalytics.ts +27 -1
- package/src/events.ts +8 -0
- package/src/insight/insightClient.spec.ts +44 -0
- package/src/insight/insightClient.ts +26 -0
- package/src/searchPage/searchPageClient.spec.ts +176 -143
- package/src/searchPage/searchPageClient.ts +227 -205
- package/src/searchPage/searchPageEvents.ts +9 -0
|
@@ -87,8 +87,18 @@ describe('SearchPageClient', () => {
|
|
|
87
87
|
fetchMock.reset();
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
+
const customDataFromMiddleware = {helloFromMiddleware: 1234};
|
|
91
|
+
|
|
90
92
|
const initClient = () => {
|
|
91
|
-
return new CoveoSearchPageClient(
|
|
93
|
+
return new CoveoSearchPageClient(
|
|
94
|
+
{
|
|
95
|
+
beforeSendHooks: [
|
|
96
|
+
(_, payload) =>
|
|
97
|
+
Promise.resolve({...payload, customData: {...payload.customData, ...customDataFromMiddleware}}),
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
provider
|
|
101
|
+
);
|
|
92
102
|
};
|
|
93
103
|
|
|
94
104
|
const expectOrigins = () => ({
|
|
@@ -105,24 +115,27 @@ describe('SearchPageClient', () => {
|
|
|
105
115
|
|
|
106
116
|
const expectMatchPayload = (actionCause: SearchPageEvents, meta = {}) => {
|
|
107
117
|
const [, {body}] = fetchMock.lastCall();
|
|
108
|
-
const customData = {foo: 'bar', ...meta};
|
|
109
|
-
expect(JSON.parse(body.toString())).
|
|
118
|
+
const customData = {foo: 'bar', ...customDataFromMiddleware, ...meta};
|
|
119
|
+
expect(JSON.parse(body.toString())).toEqual({
|
|
110
120
|
queryText: 'queryText',
|
|
111
121
|
responseTime: 123,
|
|
122
|
+
searchQueryUid: provider.getSearchUID(),
|
|
112
123
|
queryPipeline: 'my-pipeline',
|
|
113
124
|
actionCause,
|
|
125
|
+
anonymous: false,
|
|
114
126
|
customData,
|
|
115
127
|
facetState: fakeFacetState,
|
|
116
128
|
language: 'en',
|
|
117
129
|
clientId: 'visitor-id',
|
|
130
|
+
userAgent: expect.any(String),
|
|
118
131
|
...expectOrigins(),
|
|
119
132
|
...expectSplitTestRun(),
|
|
120
133
|
});
|
|
121
134
|
};
|
|
122
135
|
|
|
123
136
|
const expectMatchDescription = (description: EventDescription, actionCause: SearchPageEvents, meta = {}) => {
|
|
124
|
-
const customData = {foo: 'bar', ...meta};
|
|
125
|
-
expect(description).
|
|
137
|
+
const customData = {foo: 'bar', ...customDataFromMiddleware, ...meta};
|
|
138
|
+
expect(description).toEqual({
|
|
126
139
|
actionCause,
|
|
127
140
|
customData,
|
|
128
141
|
});
|
|
@@ -130,13 +143,17 @@ describe('SearchPageClient', () => {
|
|
|
130
143
|
|
|
131
144
|
const expectMatchDocumentPayload = (actionCause: SearchPageEvents, doc: PartialDocumentInformation, meta = {}) => {
|
|
132
145
|
const [, {body}] = fetchMock.lastCall();
|
|
133
|
-
const customData = {foo: 'bar', ...meta};
|
|
134
|
-
expect(JSON.parse(body.toString())).
|
|
146
|
+
const customData = {foo: 'bar', ...customDataFromMiddleware, ...meta};
|
|
147
|
+
expect(JSON.parse(body.toString())).toEqual({
|
|
148
|
+
anonymous: false,
|
|
135
149
|
actionCause,
|
|
136
150
|
customData,
|
|
137
151
|
queryPipeline: 'my-pipeline',
|
|
138
152
|
language: 'en',
|
|
139
153
|
clientId: 'visitor-id',
|
|
154
|
+
facetState: fakeFacetState,
|
|
155
|
+
searchQueryUid: provider.getSearchUID(),
|
|
156
|
+
userAgent: expect.any(String),
|
|
140
157
|
...doc,
|
|
141
158
|
...expectOrigins(),
|
|
142
159
|
...expectSplitTestRun(),
|
|
@@ -149,14 +166,17 @@ describe('SearchPageClient', () => {
|
|
|
149
166
|
eventType = CustomEventsTypes[actionCause]
|
|
150
167
|
) => {
|
|
151
168
|
const [, {body}] = fetchMock.lastCall();
|
|
152
|
-
const customData = {foo: 'bar', ...meta};
|
|
153
|
-
expect(JSON.parse(body.toString())).
|
|
169
|
+
const customData = {foo: 'bar', ...customDataFromMiddleware, ...meta};
|
|
170
|
+
expect(JSON.parse(body.toString())).toEqual({
|
|
171
|
+
anonymous: false,
|
|
154
172
|
eventValue: actionCause,
|
|
155
173
|
eventType,
|
|
156
174
|
lastSearchQueryUid: 'my-uid',
|
|
157
175
|
customData,
|
|
158
176
|
language: 'en',
|
|
159
177
|
clientId: 'visitor-id',
|
|
178
|
+
facetState: fakeFacetState,
|
|
179
|
+
userAgent: expect.any(String),
|
|
160
180
|
...expectOrigins(),
|
|
161
181
|
...expectSplitTestRun(),
|
|
162
182
|
});
|
|
@@ -164,14 +184,17 @@ describe('SearchPageClient', () => {
|
|
|
164
184
|
|
|
165
185
|
const expectMatchCustomEventWithTypePayload = (eventValue: string, eventType: string, meta = {}) => {
|
|
166
186
|
const [, {body}] = fetchMock.lastCall();
|
|
167
|
-
const customData = {foo: 'bar', ...meta};
|
|
168
|
-
expect(JSON.parse(body.toString())).
|
|
187
|
+
const customData = {foo: 'bar', ...customDataFromMiddleware, ...meta};
|
|
188
|
+
expect(JSON.parse(body.toString())).toEqual({
|
|
189
|
+
anonymous: false,
|
|
169
190
|
eventValue,
|
|
170
191
|
eventType,
|
|
171
192
|
lastSearchQueryUid: 'my-uid',
|
|
172
193
|
customData,
|
|
173
194
|
language: 'en',
|
|
174
195
|
clientId: 'visitor-id',
|
|
196
|
+
facetState: fakeFacetState,
|
|
197
|
+
userAgent: expect.any(String),
|
|
175
198
|
...expectOrigins(),
|
|
176
199
|
...expectSplitTestRun(),
|
|
177
200
|
});
|
|
@@ -183,8 +206,8 @@ describe('SearchPageClient', () => {
|
|
|
183
206
|
});
|
|
184
207
|
|
|
185
208
|
it('should send proper payload for #makeInterfaceLoad', async () => {
|
|
186
|
-
const built = client.makeInterfaceLoad();
|
|
187
|
-
await built.log();
|
|
209
|
+
const built = await client.makeInterfaceLoad();
|
|
210
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
188
211
|
expectMatchPayload(SearchPageEvents.interfaceLoad);
|
|
189
212
|
expectMatchDescription(built.description, SearchPageEvents.interfaceLoad);
|
|
190
213
|
});
|
|
@@ -197,8 +220,8 @@ describe('SearchPageClient', () => {
|
|
|
197
220
|
});
|
|
198
221
|
|
|
199
222
|
it('should send proper payload for #makeInterfaceChange', async () => {
|
|
200
|
-
const built = client.makeInterfaceChange({interfaceChangeTo: 'bob'});
|
|
201
|
-
await built.log();
|
|
223
|
+
const built = await client.makeInterfaceChange({interfaceChangeTo: 'bob'});
|
|
224
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
202
225
|
expectMatchPayload(SearchPageEvents.interfaceChange, {interfaceChangeTo: 'bob'});
|
|
203
226
|
expectMatchDescription(built.description, SearchPageEvents.interfaceChange, {interfaceChangeTo: 'bob'});
|
|
204
227
|
});
|
|
@@ -209,8 +232,8 @@ describe('SearchPageClient', () => {
|
|
|
209
232
|
});
|
|
210
233
|
|
|
211
234
|
it('should send proper payload for #makeDidyoumeanAutomatic', async () => {
|
|
212
|
-
const built = client.makeDidYouMeanAutomatic();
|
|
213
|
-
await built.log();
|
|
235
|
+
const built = await client.makeDidYouMeanAutomatic();
|
|
236
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
214
237
|
expectMatchPayload(SearchPageEvents.didyoumeanAutomatic);
|
|
215
238
|
expectMatchDescription(built.description, SearchPageEvents.didyoumeanAutomatic);
|
|
216
239
|
});
|
|
@@ -221,8 +244,8 @@ describe('SearchPageClient', () => {
|
|
|
221
244
|
});
|
|
222
245
|
|
|
223
246
|
it('should send proper payload for #makeDidyoumeanClick', async () => {
|
|
224
|
-
const built = client.makeDidYouMeanClick();
|
|
225
|
-
await built.log();
|
|
247
|
+
const built = await client.makeDidYouMeanClick();
|
|
248
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
226
249
|
expectMatchPayload(SearchPageEvents.didyoumeanClick);
|
|
227
250
|
expectMatchDescription(built.description, SearchPageEvents.didyoumeanClick);
|
|
228
251
|
});
|
|
@@ -233,8 +256,8 @@ describe('SearchPageClient', () => {
|
|
|
233
256
|
});
|
|
234
257
|
|
|
235
258
|
it('should send proper payload for #makeResultsSort', async () => {
|
|
236
|
-
const built = client.makeResultsSort({resultsSortBy: 'date ascending'});
|
|
237
|
-
await built.log();
|
|
259
|
+
const built = await client.makeResultsSort({resultsSortBy: 'date ascending'});
|
|
260
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
238
261
|
expectMatchPayload(SearchPageEvents.resultsSort, {resultsSortBy: 'date ascending'});
|
|
239
262
|
expectMatchDescription(built.description, SearchPageEvents.resultsSort, {resultsSortBy: 'date ascending'});
|
|
240
263
|
});
|
|
@@ -245,8 +268,8 @@ describe('SearchPageClient', () => {
|
|
|
245
268
|
});
|
|
246
269
|
|
|
247
270
|
it('should send proper payload for #makeSearchboxSubmit', async () => {
|
|
248
|
-
const built = client.makeSearchboxSubmit();
|
|
249
|
-
await built.log();
|
|
271
|
+
const built = await client.makeSearchboxSubmit();
|
|
272
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
250
273
|
expectMatchPayload(SearchPageEvents.searchboxSubmit);
|
|
251
274
|
expectMatchDescription(built.description, SearchPageEvents.searchboxSubmit);
|
|
252
275
|
});
|
|
@@ -257,8 +280,8 @@ describe('SearchPageClient', () => {
|
|
|
257
280
|
});
|
|
258
281
|
|
|
259
282
|
it('should send proper payload for #makeSearchboxClear', async () => {
|
|
260
|
-
const built = client.makeSearchboxClear();
|
|
261
|
-
await built.log();
|
|
283
|
+
const built = await client.makeSearchboxClear();
|
|
284
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
262
285
|
expectMatchPayload(SearchPageEvents.searchboxClear);
|
|
263
286
|
expectMatchDescription(built.description, SearchPageEvents.searchboxClear);
|
|
264
287
|
});
|
|
@@ -269,8 +292,8 @@ describe('SearchPageClient', () => {
|
|
|
269
292
|
});
|
|
270
293
|
|
|
271
294
|
it('should send proper payload for #makeSearchboxAsYouType', async () => {
|
|
272
|
-
const built = client.makeSearchboxAsYouType();
|
|
273
|
-
await built.log();
|
|
295
|
+
const built = await client.makeSearchboxAsYouType();
|
|
296
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
274
297
|
expectMatchPayload(SearchPageEvents.searchboxAsYouType);
|
|
275
298
|
expectMatchDescription(built.description, SearchPageEvents.searchboxAsYouType);
|
|
276
299
|
});
|
|
@@ -281,8 +304,8 @@ describe('SearchPageClient', () => {
|
|
|
281
304
|
});
|
|
282
305
|
|
|
283
306
|
it('should send proper payload for #makeDocumentQuickview', async () => {
|
|
284
|
-
const built = client.makeDocumentQuickview(fakeDocInfo, fakeDocID);
|
|
285
|
-
await built.log();
|
|
307
|
+
const built = await client.makeDocumentQuickview(fakeDocInfo, fakeDocID);
|
|
308
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
286
309
|
expectMatchDocumentPayload(SearchPageEvents.documentQuickview, fakeDocInfo, fakeDocID);
|
|
287
310
|
expectMatchDescription(built.description, SearchPageEvents.documentQuickview, {...fakeDocID});
|
|
288
311
|
});
|
|
@@ -293,8 +316,8 @@ describe('SearchPageClient', () => {
|
|
|
293
316
|
});
|
|
294
317
|
|
|
295
318
|
it('should send proper payload for #makeDocumentOpen', async () => {
|
|
296
|
-
const built = client.makeDocumentOpen(fakeDocInfo, fakeDocID);
|
|
297
|
-
await built.log();
|
|
319
|
+
const built = await client.makeDocumentOpen(fakeDocInfo, fakeDocID);
|
|
320
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
298
321
|
expectMatchDocumentPayload(SearchPageEvents.documentOpen, fakeDocInfo, fakeDocID);
|
|
299
322
|
expectMatchDescription(built.description, SearchPageEvents.documentOpen, {...fakeDocID});
|
|
300
323
|
});
|
|
@@ -305,8 +328,8 @@ describe('SearchPageClient', () => {
|
|
|
305
328
|
});
|
|
306
329
|
|
|
307
330
|
it('should send proper payload for #makeShowMoreFoldedResults', async () => {
|
|
308
|
-
const built = client.makeShowMoreFoldedResults(fakeDocInfo, fakeDocID);
|
|
309
|
-
await built.log();
|
|
331
|
+
const built = await client.makeShowMoreFoldedResults(fakeDocInfo, fakeDocID);
|
|
332
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
310
333
|
expectMatchDocumentPayload(SearchPageEvents.showMoreFoldedResults, fakeDocInfo, fakeDocID);
|
|
311
334
|
expectMatchDescription(built.description, SearchPageEvents.showMoreFoldedResults, fakeDocID);
|
|
312
335
|
});
|
|
@@ -317,8 +340,8 @@ describe('SearchPageClient', () => {
|
|
|
317
340
|
});
|
|
318
341
|
|
|
319
342
|
it('should send proper payload for #makeShowLessFoldedResults', async () => {
|
|
320
|
-
const built = client.makeShowLessFoldedResults();
|
|
321
|
-
await built.log();
|
|
343
|
+
const built = await client.makeShowLessFoldedResults();
|
|
344
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
322
345
|
expectMatchCustomEventPayload(SearchPageEvents.showLessFoldedResults);
|
|
323
346
|
expectMatchDescription(built.description, SearchPageEvents.showLessFoldedResults);
|
|
324
347
|
});
|
|
@@ -343,8 +366,8 @@ describe('SearchPageClient', () => {
|
|
|
343
366
|
suggestions: 'q;w;e;r;t;y',
|
|
344
367
|
querySuggestResponseId: '1',
|
|
345
368
|
};
|
|
346
|
-
const built = client.makeOmniboxAnalytics(meta);
|
|
347
|
-
await built.log();
|
|
369
|
+
const built = await client.makeOmniboxAnalytics(meta);
|
|
370
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
348
371
|
expectMatchPayload(SearchPageEvents.omniboxAnalytics, meta);
|
|
349
372
|
expectMatchDescription(built.description, SearchPageEvents.omniboxAnalytics, meta);
|
|
350
373
|
});
|
|
@@ -369,8 +392,8 @@ describe('SearchPageClient', () => {
|
|
|
369
392
|
suggestions: 'q;w;e;r;t;y',
|
|
370
393
|
querySuggestResponseId: '1',
|
|
371
394
|
};
|
|
372
|
-
const built = client.makeOmniboxFromLink(meta);
|
|
373
|
-
await built.log();
|
|
395
|
+
const built = await client.makeOmniboxFromLink(meta);
|
|
396
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
374
397
|
expectMatchPayload(SearchPageEvents.omniboxFromLink, meta);
|
|
375
398
|
expectMatchDescription(built.description, SearchPageEvents.omniboxFromLink, meta);
|
|
376
399
|
});
|
|
@@ -381,8 +404,8 @@ describe('SearchPageClient', () => {
|
|
|
381
404
|
});
|
|
382
405
|
|
|
383
406
|
it('should send proper payload for #makeSearchFromLink', async () => {
|
|
384
|
-
const built = client.makeSearchFromLink();
|
|
385
|
-
await built.log();
|
|
407
|
+
const built = await client.makeSearchFromLink();
|
|
408
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
386
409
|
expectMatchPayload(SearchPageEvents.searchFromLink);
|
|
387
410
|
expectMatchDescription(built.description, SearchPageEvents.searchFromLink);
|
|
388
411
|
});
|
|
@@ -399,8 +422,8 @@ describe('SearchPageClient', () => {
|
|
|
399
422
|
const meta = {
|
|
400
423
|
notifications: ['foo', 'bar'],
|
|
401
424
|
};
|
|
402
|
-
const built = client.makeTriggerNotify(meta);
|
|
403
|
-
await built.log();
|
|
425
|
+
const built = await client.makeTriggerNotify(meta);
|
|
426
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
404
427
|
expectMatchCustomEventPayload(SearchPageEvents.triggerNotify, meta);
|
|
405
428
|
expectMatchDescription(built.description, SearchPageEvents.triggerNotify, meta);
|
|
406
429
|
});
|
|
@@ -423,8 +446,8 @@ describe('SearchPageClient', () => {
|
|
|
423
446
|
{functionName: 'world', params: []},
|
|
424
447
|
],
|
|
425
448
|
};
|
|
426
|
-
const built = client.makeTriggerExecute(meta);
|
|
427
|
-
await built.log();
|
|
449
|
+
const built = await client.makeTriggerExecute(meta);
|
|
450
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
428
451
|
expectMatchCustomEventPayload(SearchPageEvents.triggerExecute, meta);
|
|
429
452
|
expectMatchDescription(built.description, SearchPageEvents.triggerExecute, meta);
|
|
430
453
|
});
|
|
@@ -441,8 +464,8 @@ describe('SearchPageClient', () => {
|
|
|
441
464
|
const meta = {
|
|
442
465
|
query: 'queryText',
|
|
443
466
|
};
|
|
444
|
-
const built = client.makeTriggerQuery();
|
|
445
|
-
await built.log();
|
|
467
|
+
const built = await client.makeTriggerQuery();
|
|
468
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
446
469
|
expectMatchCustomEventPayload(SearchPageEvents.triggerQuery, meta, 'queryPipelineTriggers');
|
|
447
470
|
expectMatchDescription(built.description, SearchPageEvents.triggerQuery, meta);
|
|
448
471
|
});
|
|
@@ -459,8 +482,8 @@ describe('SearchPageClient', () => {
|
|
|
459
482
|
const meta = {
|
|
460
483
|
undoneQuery: 'foo',
|
|
461
484
|
};
|
|
462
|
-
const built = client.makeUndoTriggerQuery(meta);
|
|
463
|
-
await built.log();
|
|
485
|
+
const built = await client.makeUndoTriggerQuery(meta);
|
|
486
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
464
487
|
expectMatchPayload(SearchPageEvents.undoTriggerQuery, meta);
|
|
465
488
|
expectMatchDescription(built.description, SearchPageEvents.undoTriggerQuery, meta);
|
|
466
489
|
});
|
|
@@ -468,6 +491,7 @@ describe('SearchPageClient', () => {
|
|
|
468
491
|
it('should send proper payload for #logTriggerRedirect', async () => {
|
|
469
492
|
const meta = {
|
|
470
493
|
redirectedTo: 'foo',
|
|
494
|
+
query: provider.getSearchEventRequestPayload().queryText,
|
|
471
495
|
};
|
|
472
496
|
await client.logTriggerRedirect(meta);
|
|
473
497
|
expectMatchCustomEventPayload(SearchPageEvents.triggerRedirect, meta);
|
|
@@ -476,9 +500,10 @@ describe('SearchPageClient', () => {
|
|
|
476
500
|
it('should send proper payload for #makeTriggerRedirect', async () => {
|
|
477
501
|
const meta = {
|
|
478
502
|
redirectedTo: 'foo',
|
|
503
|
+
query: provider.getSearchEventRequestPayload().queryText,
|
|
479
504
|
};
|
|
480
|
-
const built = client.makeTriggerRedirect(meta);
|
|
481
|
-
await built.log();
|
|
505
|
+
const built = await client.makeTriggerRedirect(meta);
|
|
506
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
482
507
|
expectMatchCustomEventPayload(SearchPageEvents.triggerRedirect, meta);
|
|
483
508
|
expectMatchDescription(built.description, SearchPageEvents.triggerRedirect, meta);
|
|
484
509
|
});
|
|
@@ -495,8 +520,8 @@ describe('SearchPageClient', () => {
|
|
|
495
520
|
const meta = {
|
|
496
521
|
currentResultsPerPage: 123,
|
|
497
522
|
};
|
|
498
|
-
const built = client.makePagerResize(meta);
|
|
499
|
-
await built.log();
|
|
523
|
+
const built = await client.makePagerResize(meta);
|
|
524
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
500
525
|
expectMatchCustomEventPayload(SearchPageEvents.pagerResize, meta);
|
|
501
526
|
expectMatchDescription(built.description, SearchPageEvents.pagerResize, meta);
|
|
502
527
|
});
|
|
@@ -509,8 +534,8 @@ describe('SearchPageClient', () => {
|
|
|
509
534
|
|
|
510
535
|
it('should send proper payload for #makePagerNumber', async () => {
|
|
511
536
|
const meta = {pagerNumber: 123};
|
|
512
|
-
const built = client.makePagerNumber(meta);
|
|
513
|
-
await built.log();
|
|
537
|
+
const built = await client.makePagerNumber(meta);
|
|
538
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
514
539
|
expectMatchCustomEventPayload(SearchPageEvents.pagerNumber, meta);
|
|
515
540
|
expectMatchDescription(built.description, SearchPageEvents.pagerNumber, meta);
|
|
516
541
|
});
|
|
@@ -523,8 +548,8 @@ describe('SearchPageClient', () => {
|
|
|
523
548
|
|
|
524
549
|
it('should send proper payload for #makePagerNext', async () => {
|
|
525
550
|
const meta = {pagerNumber: 123};
|
|
526
|
-
const built = client.makePagerNext(meta);
|
|
527
|
-
await built.log();
|
|
551
|
+
const built = await client.makePagerNext(meta);
|
|
552
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
528
553
|
expectMatchCustomEventPayload(SearchPageEvents.pagerNext, meta);
|
|
529
554
|
expectMatchDescription(built.description, SearchPageEvents.pagerNext, meta);
|
|
530
555
|
});
|
|
@@ -537,8 +562,8 @@ describe('SearchPageClient', () => {
|
|
|
537
562
|
|
|
538
563
|
it('should send proper payload for #makePagerPrevious', async () => {
|
|
539
564
|
const meta = {pagerNumber: 123};
|
|
540
|
-
const built = client.makePagerPrevious(meta);
|
|
541
|
-
await built.log();
|
|
565
|
+
const built = await client.makePagerPrevious(meta);
|
|
566
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
542
567
|
expectMatchCustomEventPayload(SearchPageEvents.pagerPrevious, meta);
|
|
543
568
|
expectMatchDescription(built.description, SearchPageEvents.pagerPrevious, meta);
|
|
544
569
|
});
|
|
@@ -549,8 +574,8 @@ describe('SearchPageClient', () => {
|
|
|
549
574
|
});
|
|
550
575
|
|
|
551
576
|
it('should send proper payload for #makePagerScrolling', async () => {
|
|
552
|
-
const built = client.makePagerScrolling();
|
|
553
|
-
await built.log();
|
|
577
|
+
const built = await client.makePagerScrolling();
|
|
578
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
554
579
|
expectMatchCustomEventPayload(SearchPageEvents.pagerScrolling);
|
|
555
580
|
expectMatchDescription(built.description, SearchPageEvents.pagerScrolling);
|
|
556
581
|
});
|
|
@@ -564,8 +589,8 @@ describe('SearchPageClient', () => {
|
|
|
564
589
|
|
|
565
590
|
it('should send the proper payload for #makeStaticFilterClearAll', async () => {
|
|
566
591
|
const staticFilterId = 'filetypes';
|
|
567
|
-
const built = client.makeStaticFilterClearAll({staticFilterId});
|
|
568
|
-
await built.log();
|
|
592
|
+
const built = await client.makeStaticFilterClearAll({staticFilterId});
|
|
593
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
569
594
|
expectMatchPayload(SearchPageEvents.staticFilterClearAll, {staticFilterId});
|
|
570
595
|
expectMatchDescription(built.description, SearchPageEvents.staticFilterClearAll, {staticFilterId});
|
|
571
596
|
});
|
|
@@ -591,8 +616,8 @@ describe('SearchPageClient', () => {
|
|
|
591
616
|
expression: '@filetype="youtubevideo"',
|
|
592
617
|
},
|
|
593
618
|
};
|
|
594
|
-
const built = client.makeStaticFilterSelect(meta);
|
|
595
|
-
await built.log();
|
|
619
|
+
const built = await client.makeStaticFilterSelect(meta);
|
|
620
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
596
621
|
|
|
597
622
|
expectMatchPayload(SearchPageEvents.staticFilterSelect, meta);
|
|
598
623
|
expectMatchDescription(built.description, SearchPageEvents.staticFilterSelect, meta);
|
|
@@ -619,8 +644,8 @@ describe('SearchPageClient', () => {
|
|
|
619
644
|
expression: '@filetype="youtubevideo"',
|
|
620
645
|
},
|
|
621
646
|
};
|
|
622
|
-
const built = client.makeStaticFilterDeselect(meta);
|
|
623
|
-
await built.log();
|
|
647
|
+
const built = await client.makeStaticFilterDeselect(meta);
|
|
648
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
624
649
|
expectMatchPayload(SearchPageEvents.staticFilterDeselect, meta);
|
|
625
650
|
expectMatchDescription(built.description, SearchPageEvents.staticFilterDeselect, meta);
|
|
626
651
|
});
|
|
@@ -641,8 +666,8 @@ describe('SearchPageClient', () => {
|
|
|
641
666
|
facetId: 'bar',
|
|
642
667
|
facetTitle: 'title',
|
|
643
668
|
};
|
|
644
|
-
const built = client.makeFacetSearch(meta);
|
|
645
|
-
await built.log();
|
|
669
|
+
const built = await client.makeFacetSearch(meta);
|
|
670
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
646
671
|
expectMatchPayload(SearchPageEvents.facetSearch, meta);
|
|
647
672
|
expectMatchDescription(built.description, SearchPageEvents.facetSearch, meta);
|
|
648
673
|
});
|
|
@@ -667,7 +692,7 @@ describe('SearchPageClient', () => {
|
|
|
667
692
|
facetValue: 'qwerty',
|
|
668
693
|
};
|
|
669
694
|
const built = await client.makeFacetSelect(meta);
|
|
670
|
-
await built.log();
|
|
695
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
671
696
|
expectMatchPayload(SearchPageEvents.facetSelect, meta);
|
|
672
697
|
expectMatchDescription(built.description, SearchPageEvents.facetSelect, meta);
|
|
673
698
|
});
|
|
@@ -692,8 +717,8 @@ describe('SearchPageClient', () => {
|
|
|
692
717
|
facetValue: 'qwerty',
|
|
693
718
|
};
|
|
694
719
|
|
|
695
|
-
const built = client.makeFacetDeselect(meta);
|
|
696
|
-
await built.log();
|
|
720
|
+
const built = await client.makeFacetDeselect(meta);
|
|
721
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
697
722
|
expectMatchPayload(SearchPageEvents.facetDeselect, meta);
|
|
698
723
|
expectMatchDescription(built.description, SearchPageEvents.facetDeselect, meta);
|
|
699
724
|
});
|
|
@@ -716,8 +741,8 @@ describe('SearchPageClient', () => {
|
|
|
716
741
|
facetTitle: 'title',
|
|
717
742
|
facetValue: 'qwerty',
|
|
718
743
|
};
|
|
719
|
-
const built = client.makeFacetExclude(meta);
|
|
720
|
-
await built.log();
|
|
744
|
+
const built = await client.makeFacetExclude(meta);
|
|
745
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
721
746
|
expectMatchPayload(SearchPageEvents.facetExclude, meta);
|
|
722
747
|
expectMatchDescription(built.description, SearchPageEvents.facetExclude, meta);
|
|
723
748
|
});
|
|
@@ -740,8 +765,8 @@ describe('SearchPageClient', () => {
|
|
|
740
765
|
facetTitle: 'title',
|
|
741
766
|
facetValue: 'qwerty',
|
|
742
767
|
};
|
|
743
|
-
const built = client.makeFacetUnexclude(meta);
|
|
744
|
-
await built.log();
|
|
768
|
+
const built = await client.makeFacetUnexclude(meta);
|
|
769
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
745
770
|
expectMatchPayload(SearchPageEvents.facetUnexclude, meta);
|
|
746
771
|
expectMatchDescription(built.description, SearchPageEvents.facetUnexclude, meta);
|
|
747
772
|
});
|
|
@@ -762,8 +787,8 @@ describe('SearchPageClient', () => {
|
|
|
762
787
|
facetId: 'bar',
|
|
763
788
|
facetTitle: 'title',
|
|
764
789
|
};
|
|
765
|
-
const built = client.makeFacetSelectAll(meta);
|
|
766
|
-
await built.log();
|
|
790
|
+
const built = await client.makeFacetSelectAll(meta);
|
|
791
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
767
792
|
expectMatchPayload(SearchPageEvents.facetSelectAll, meta);
|
|
768
793
|
expectMatchDescription(built.description, SearchPageEvents.facetSelectAll, meta);
|
|
769
794
|
});
|
|
@@ -786,8 +811,8 @@ describe('SearchPageClient', () => {
|
|
|
786
811
|
facetTitle: 'title',
|
|
787
812
|
criteria: 'bazz',
|
|
788
813
|
};
|
|
789
|
-
const built = client.makeFacetUpdateSort(meta);
|
|
790
|
-
await built.log();
|
|
814
|
+
const built = await client.makeFacetUpdateSort(meta);
|
|
815
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
791
816
|
expectMatchPayload(SearchPageEvents.facetUpdateSort, meta);
|
|
792
817
|
expectMatchDescription(built.description, SearchPageEvents.facetUpdateSort, meta);
|
|
793
818
|
});
|
|
@@ -808,8 +833,8 @@ describe('SearchPageClient', () => {
|
|
|
808
833
|
facetId: 'bar',
|
|
809
834
|
facetTitle: 'title',
|
|
810
835
|
};
|
|
811
|
-
const built = client.makeFacetShowMore(meta);
|
|
812
|
-
await built.log();
|
|
836
|
+
const built = await client.makeFacetShowMore(meta);
|
|
837
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
813
838
|
expectMatchCustomEventPayload(SearchPageEvents.facetShowMore, meta);
|
|
814
839
|
expectMatchDescription(built.description, SearchPageEvents.facetShowMore, meta);
|
|
815
840
|
});
|
|
@@ -830,8 +855,8 @@ describe('SearchPageClient', () => {
|
|
|
830
855
|
facetId: 'bar',
|
|
831
856
|
facetTitle: 'title',
|
|
832
857
|
};
|
|
833
|
-
const built = client.makeFacetShowLess(meta);
|
|
834
|
-
await built.log();
|
|
858
|
+
const built = await client.makeFacetShowLess(meta);
|
|
859
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
835
860
|
expectMatchCustomEventPayload(SearchPageEvents.facetShowLess, meta);
|
|
836
861
|
expectMatchDescription(built.description, SearchPageEvents.facetShowLess, meta);
|
|
837
862
|
});
|
|
@@ -858,8 +883,8 @@ describe('SearchPageClient', () => {
|
|
|
858
883
|
errorMessage: 'boom',
|
|
859
884
|
errorType: 'a bad one',
|
|
860
885
|
};
|
|
861
|
-
const built = client.makeQueryError(meta);
|
|
862
|
-
await built.log();
|
|
886
|
+
const built = await client.makeQueryError(meta);
|
|
887
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
863
888
|
expectMatchCustomEventPayload(SearchPageEvents.queryError, meta);
|
|
864
889
|
expectMatchDescription(built.description, SearchPageEvents.queryError, meta);
|
|
865
890
|
});
|
|
@@ -870,8 +895,8 @@ describe('SearchPageClient', () => {
|
|
|
870
895
|
});
|
|
871
896
|
|
|
872
897
|
it('should send proper payload for #makeQueryErrorBack', async () => {
|
|
873
|
-
const built = client.makeQueryErrorBack();
|
|
874
|
-
await built.log();
|
|
898
|
+
const built = await client.makeQueryErrorBack();
|
|
899
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
875
900
|
|
|
876
901
|
expectMatchPayload(SearchPageEvents.queryErrorBack);
|
|
877
902
|
expectMatchDescription(built.description, SearchPageEvents.queryErrorBack);
|
|
@@ -883,8 +908,8 @@ describe('SearchPageClient', () => {
|
|
|
883
908
|
});
|
|
884
909
|
|
|
885
910
|
it('should send proper payload for #makeQueryErrorRetry', async () => {
|
|
886
|
-
const built = client.makeQueryErrorRetry();
|
|
887
|
-
await built.log();
|
|
911
|
+
const built = await client.makeQueryErrorRetry();
|
|
912
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
888
913
|
expectMatchPayload(SearchPageEvents.queryErrorRetry);
|
|
889
914
|
expectMatchDescription(built.description, SearchPageEvents.queryErrorRetry);
|
|
890
915
|
});
|
|
@@ -895,8 +920,8 @@ describe('SearchPageClient', () => {
|
|
|
895
920
|
});
|
|
896
921
|
|
|
897
922
|
it('should send proper payload for #makeQueryErrorClear', async () => {
|
|
898
|
-
const built = client.makeQueryErrorClear();
|
|
899
|
-
await built.log();
|
|
923
|
+
const built = await client.makeQueryErrorClear();
|
|
924
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
900
925
|
expectMatchPayload(SearchPageEvents.queryErrorClear);
|
|
901
926
|
expectMatchDescription(built.description, SearchPageEvents.queryErrorClear);
|
|
902
927
|
});
|
|
@@ -907,8 +932,8 @@ describe('SearchPageClient', () => {
|
|
|
907
932
|
});
|
|
908
933
|
|
|
909
934
|
it('should send proper payload for #makeRecommendationInterfaceLoad', async () => {
|
|
910
|
-
const built = client.makeRecommendationInterfaceLoad();
|
|
911
|
-
await built.log();
|
|
935
|
+
const built = await client.makeRecommendationInterfaceLoad();
|
|
936
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
912
937
|
expectMatchPayload(SearchPageEvents.recommendationInterfaceLoad);
|
|
913
938
|
expectMatchDescription(built.description, SearchPageEvents.recommendationInterfaceLoad);
|
|
914
939
|
});
|
|
@@ -919,8 +944,8 @@ describe('SearchPageClient', () => {
|
|
|
919
944
|
});
|
|
920
945
|
|
|
921
946
|
it('should send proper payload for #makeRecommendation', async () => {
|
|
922
|
-
const built = client.makeRecommendation();
|
|
923
|
-
await built.log();
|
|
947
|
+
const built = await client.makeRecommendation();
|
|
948
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
924
949
|
expectMatchCustomEventPayload(SearchPageEvents.recommendation);
|
|
925
950
|
});
|
|
926
951
|
|
|
@@ -930,8 +955,8 @@ describe('SearchPageClient', () => {
|
|
|
930
955
|
});
|
|
931
956
|
|
|
932
957
|
it('should send proper payload for #makeRecommendationOpen', async () => {
|
|
933
|
-
const built = client.makeRecommendationOpen(fakeDocInfo, fakeDocID);
|
|
934
|
-
await built.log();
|
|
958
|
+
const built = await client.makeRecommendationOpen(fakeDocInfo, fakeDocID);
|
|
959
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
935
960
|
expectMatchDocumentPayload(SearchPageEvents.recommendationOpen, fakeDocInfo, fakeDocID);
|
|
936
961
|
expectMatchDescription(built.description, SearchPageEvents.recommendationOpen, {...fakeDocID});
|
|
937
962
|
});
|
|
@@ -942,10 +967,10 @@ describe('SearchPageClient', () => {
|
|
|
942
967
|
});
|
|
943
968
|
|
|
944
969
|
it('should send proper payload for #makeFetchMoreResults', async () => {
|
|
945
|
-
const built = client.makeFetchMoreResults();
|
|
946
|
-
await built.log();
|
|
970
|
+
const built = await client.makeFetchMoreResults();
|
|
971
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
947
972
|
expectMatchCustomEventPayload(SearchPageEvents.pagerScrolling, {type: 'getMoreResults'});
|
|
948
|
-
expectMatchDescription(built.description, SearchPageEvents.pagerScrolling);
|
|
973
|
+
expectMatchDescription(built.description, SearchPageEvents.pagerScrolling, {type: 'getMoreResults'});
|
|
949
974
|
});
|
|
950
975
|
|
|
951
976
|
it('should send proper payload for #logLikeSmartSnippet', async () => {
|
|
@@ -954,8 +979,8 @@ describe('SearchPageClient', () => {
|
|
|
954
979
|
});
|
|
955
980
|
|
|
956
981
|
it('should send proper payload for #makeLikeSmartSnippet', async () => {
|
|
957
|
-
const built = client.makeLikeSmartSnippet();
|
|
958
|
-
await built.log();
|
|
982
|
+
const built = await client.makeLikeSmartSnippet();
|
|
983
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
959
984
|
expectMatchCustomEventPayload(SearchPageEvents.likeSmartSnippet);
|
|
960
985
|
expectMatchDescription(built.description, SearchPageEvents.likeSmartSnippet);
|
|
961
986
|
});
|
|
@@ -966,8 +991,8 @@ describe('SearchPageClient', () => {
|
|
|
966
991
|
});
|
|
967
992
|
|
|
968
993
|
it('should send proper payload for #makeDislikeSmartSnippet', async () => {
|
|
969
|
-
const built = client.makeDislikeSmartSnippet();
|
|
970
|
-
await built.log();
|
|
994
|
+
const built = await client.makeDislikeSmartSnippet();
|
|
995
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
971
996
|
expectMatchCustomEventPayload(SearchPageEvents.dislikeSmartSnippet);
|
|
972
997
|
expectMatchDescription(built.description, SearchPageEvents.dislikeSmartSnippet);
|
|
973
998
|
});
|
|
@@ -978,8 +1003,8 @@ describe('SearchPageClient', () => {
|
|
|
978
1003
|
});
|
|
979
1004
|
|
|
980
1005
|
it('should send proper payload for #makeExpandSmartSnippet', async () => {
|
|
981
|
-
const built = client.makeExpandSmartSnippet();
|
|
982
|
-
await built.log();
|
|
1006
|
+
const built = await client.makeExpandSmartSnippet();
|
|
1007
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
983
1008
|
expectMatchCustomEventPayload(SearchPageEvents.expandSmartSnippet);
|
|
984
1009
|
expectMatchDescription(built.description, SearchPageEvents.expandSmartSnippet);
|
|
985
1010
|
});
|
|
@@ -990,8 +1015,8 @@ describe('SearchPageClient', () => {
|
|
|
990
1015
|
});
|
|
991
1016
|
|
|
992
1017
|
it('should send proper payload for #makeCollapseSmartSnippet', async () => {
|
|
993
|
-
const built = client.makeCollapseSmartSnippet();
|
|
994
|
-
await built.log();
|
|
1018
|
+
const built = await client.makeCollapseSmartSnippet();
|
|
1019
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
995
1020
|
expectMatchCustomEventPayload(SearchPageEvents.collapseSmartSnippet);
|
|
996
1021
|
expectMatchDescription(built.description, SearchPageEvents.collapseSmartSnippet);
|
|
997
1022
|
});
|
|
@@ -1002,8 +1027,8 @@ describe('SearchPageClient', () => {
|
|
|
1002
1027
|
});
|
|
1003
1028
|
|
|
1004
1029
|
it('should send proper payload for #makeOpenSmartSnippetFeedbackModal', async () => {
|
|
1005
|
-
const built = client.makeOpenSmartSnippetFeedbackModal();
|
|
1006
|
-
await built.log();
|
|
1030
|
+
const built = await client.makeOpenSmartSnippetFeedbackModal();
|
|
1031
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1007
1032
|
expectMatchCustomEventPayload(SearchPageEvents.openSmartSnippetFeedbackModal);
|
|
1008
1033
|
expectMatchDescription(built.description, SearchPageEvents.openSmartSnippetFeedbackModal);
|
|
1009
1034
|
});
|
|
@@ -1014,8 +1039,8 @@ describe('SearchPageClient', () => {
|
|
|
1014
1039
|
});
|
|
1015
1040
|
|
|
1016
1041
|
it('should send proper payload for #makeCloseSmartSnippetFeedbackModal', async () => {
|
|
1017
|
-
const built = client.makeCloseSmartSnippetFeedbackModal();
|
|
1018
|
-
await built.log();
|
|
1042
|
+
const built = await client.makeCloseSmartSnippetFeedbackModal();
|
|
1043
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1019
1044
|
expectMatchCustomEventPayload(SearchPageEvents.closeSmartSnippetFeedbackModal);
|
|
1020
1045
|
expectMatchDescription(built.description, SearchPageEvents.closeSmartSnippetFeedbackModal);
|
|
1021
1046
|
});
|
|
@@ -1029,8 +1054,8 @@ describe('SearchPageClient', () => {
|
|
|
1029
1054
|
});
|
|
1030
1055
|
|
|
1031
1056
|
it('should send proper payload for #makeSmartSnippetFeedbackReason', async () => {
|
|
1032
|
-
const built = client.makeSmartSnippetFeedbackReason('does_not_answer', 'this is irrelevant');
|
|
1033
|
-
await built.log();
|
|
1057
|
+
const built = await client.makeSmartSnippetFeedbackReason('does_not_answer', 'this is irrelevant');
|
|
1058
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1034
1059
|
expectMatchCustomEventPayload(SearchPageEvents.sendSmartSnippetReason, {
|
|
1035
1060
|
details: 'this is irrelevant',
|
|
1036
1061
|
reason: 'does_not_answer',
|
|
@@ -1055,12 +1080,12 @@ describe('SearchPageClient', () => {
|
|
|
1055
1080
|
});
|
|
1056
1081
|
|
|
1057
1082
|
it('should send proper payload for #makeExpandSmartSnippetSuggestion', async () => {
|
|
1058
|
-
const built = client.makeExpandSmartSnippetSuggestion({
|
|
1083
|
+
const built = await client.makeExpandSmartSnippetSuggestion({
|
|
1059
1084
|
question: 'Abc',
|
|
1060
1085
|
answerSnippet: 'Def',
|
|
1061
1086
|
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
1062
1087
|
});
|
|
1063
|
-
await built.log();
|
|
1088
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1064
1089
|
expectMatchCustomEventPayload(SearchPageEvents.expandSmartSnippetSuggestion, {
|
|
1065
1090
|
question: 'Abc',
|
|
1066
1091
|
answerSnippet: 'Def',
|
|
@@ -1087,12 +1112,12 @@ describe('SearchPageClient', () => {
|
|
|
1087
1112
|
});
|
|
1088
1113
|
|
|
1089
1114
|
it('should send proper payload for #makeCollapseSmartSnippetSuggestion', async () => {
|
|
1090
|
-
const built = client.makeCollapseSmartSnippetSuggestion({
|
|
1115
|
+
const built = await client.makeCollapseSmartSnippetSuggestion({
|
|
1091
1116
|
question: 'Abc',
|
|
1092
1117
|
answerSnippet: 'Def',
|
|
1093
1118
|
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
1094
1119
|
});
|
|
1095
|
-
await built.log();
|
|
1120
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1096
1121
|
expectMatchCustomEventPayload(SearchPageEvents.collapseSmartSnippetSuggestion, {
|
|
1097
1122
|
question: 'Abc',
|
|
1098
1123
|
answerSnippet: 'Def',
|
|
@@ -1113,11 +1138,11 @@ describe('SearchPageClient', () => {
|
|
|
1113
1138
|
});
|
|
1114
1139
|
|
|
1115
1140
|
it('should send proper payload for #makeExpandSmartSnippetSuggestion when called with only the documentId', async () => {
|
|
1116
|
-
const built = client.makeExpandSmartSnippetSuggestion({
|
|
1141
|
+
const built = await client.makeExpandSmartSnippetSuggestion({
|
|
1117
1142
|
contentIdKey: 'permanentid',
|
|
1118
1143
|
contentIdValue: 'foo',
|
|
1119
1144
|
});
|
|
1120
|
-
await built.log();
|
|
1145
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1121
1146
|
expectMatchCustomEventPayload(SearchPageEvents.expandSmartSnippetSuggestion, {
|
|
1122
1147
|
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
1123
1148
|
});
|
|
@@ -1134,8 +1159,11 @@ describe('SearchPageClient', () => {
|
|
|
1134
1159
|
});
|
|
1135
1160
|
|
|
1136
1161
|
it('should send proper payload for #makeCollapseSmartSnippetSuggestion when called with only the documentId', async () => {
|
|
1137
|
-
const built = client.makeCollapseSmartSnippetSuggestion({
|
|
1138
|
-
|
|
1162
|
+
const built = await client.makeCollapseSmartSnippetSuggestion({
|
|
1163
|
+
contentIdKey: 'permanentid',
|
|
1164
|
+
contentIdValue: 'foo',
|
|
1165
|
+
});
|
|
1166
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1139
1167
|
expectMatchCustomEventPayload(SearchPageEvents.collapseSmartSnippetSuggestion, {
|
|
1140
1168
|
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
1141
1169
|
});
|
|
@@ -1153,6 +1181,7 @@ describe('SearchPageClient', () => {
|
|
|
1153
1181
|
expectMatchCustomEventPayload(SearchPageEvents.showMoreSmartSnippetSuggestion, {
|
|
1154
1182
|
question: 'Abc',
|
|
1155
1183
|
answerSnippet: 'Def',
|
|
1184
|
+
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
1156
1185
|
});
|
|
1157
1186
|
});
|
|
1158
1187
|
|
|
@@ -1180,8 +1209,8 @@ describe('SearchPageClient', () => {
|
|
|
1180
1209
|
});
|
|
1181
1210
|
|
|
1182
1211
|
it('should send proper payload for #makeOpenSmartSnippetSource', async () => {
|
|
1183
|
-
const built = client.makeOpenSmartSnippetSource(fakeDocInfo, fakeDocID);
|
|
1184
|
-
await built.log();
|
|
1212
|
+
const built = await client.makeOpenSmartSnippetSource(fakeDocInfo, fakeDocID);
|
|
1213
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1185
1214
|
expectMatchDocumentPayload(SearchPageEvents.openSmartSnippetSource, fakeDocInfo, fakeDocID);
|
|
1186
1215
|
expectMatchDescription(built.description, SearchPageEvents.openSmartSnippetSource, {...fakeDocID});
|
|
1187
1216
|
});
|
|
@@ -1204,10 +1233,12 @@ describe('SearchPageClient', () => {
|
|
|
1204
1233
|
const meta = {
|
|
1205
1234
|
question: 'Abc',
|
|
1206
1235
|
answerSnippet: 'Def',
|
|
1236
|
+
contentIDKey: 'permanentid',
|
|
1237
|
+
contentIDValue: 'foo',
|
|
1207
1238
|
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
1208
1239
|
};
|
|
1209
|
-
const built = client.makeOpenSmartSnippetSuggestionSource(fakeDocInfo, meta);
|
|
1210
|
-
await built.log();
|
|
1240
|
+
const built = await client.makeOpenSmartSnippetSuggestionSource(fakeDocInfo, meta);
|
|
1241
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1211
1242
|
expectMatchDocumentPayload(SearchPageEvents.openSmartSnippetSuggestionSource, fakeDocInfo, meta);
|
|
1212
1243
|
expectMatchDescription(built.description, SearchPageEvents.openSmartSnippetSuggestionSource, meta);
|
|
1213
1244
|
});
|
|
@@ -1228,8 +1259,8 @@ describe('SearchPageClient', () => {
|
|
|
1228
1259
|
linkText: 'Some text',
|
|
1229
1260
|
linkURL: 'https://invalid.com',
|
|
1230
1261
|
};
|
|
1231
|
-
const built = client.makeOpenSmartSnippetInlineLink(fakeDocInfo, meta);
|
|
1232
|
-
await built.log();
|
|
1262
|
+
const built = await client.makeOpenSmartSnippetInlineLink(fakeDocInfo, meta);
|
|
1263
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1233
1264
|
expectMatchDocumentPayload(SearchPageEvents.openSmartSnippetInlineLink, fakeDocInfo, meta);
|
|
1234
1265
|
expectMatchDescription(built.description, SearchPageEvents.openSmartSnippetInlineLink, meta);
|
|
1235
1266
|
});
|
|
@@ -1254,12 +1285,14 @@ describe('SearchPageClient', () => {
|
|
|
1254
1285
|
const meta = {
|
|
1255
1286
|
question: 'Abc',
|
|
1256
1287
|
answerSnippet: 'Def',
|
|
1288
|
+
contentIDKey: 'permanentid',
|
|
1289
|
+
contentIDValue: 'foo',
|
|
1257
1290
|
documentId: {contentIdKey: 'permanentid', contentIdValue: 'foo'},
|
|
1258
1291
|
linkText: 'Some text',
|
|
1259
1292
|
linkURL: 'https://invalid.com',
|
|
1260
1293
|
};
|
|
1261
|
-
const built = client.makeOpenSmartSnippetSuggestionInlineLink(fakeDocInfo, meta);
|
|
1262
|
-
await built.log();
|
|
1294
|
+
const built = await client.makeOpenSmartSnippetSuggestionInlineLink(fakeDocInfo, meta);
|
|
1295
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1263
1296
|
expectMatchDocumentPayload(SearchPageEvents.openSmartSnippetSuggestionInlineLink, fakeDocInfo, meta);
|
|
1264
1297
|
expectMatchDescription(built.description, SearchPageEvents.openSmartSnippetSuggestionInlineLink, meta);
|
|
1265
1298
|
});
|
|
@@ -1270,8 +1303,8 @@ describe('SearchPageClient', () => {
|
|
|
1270
1303
|
});
|
|
1271
1304
|
|
|
1272
1305
|
it('should send proper payload for #makeRecentQueryClick', async () => {
|
|
1273
|
-
const built = client.makeRecentQueryClick();
|
|
1274
|
-
await built.log();
|
|
1306
|
+
const built = await client.makeRecentQueryClick();
|
|
1307
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1275
1308
|
|
|
1276
1309
|
expectMatchPayload(SearchPageEvents.recentQueryClick);
|
|
1277
1310
|
expectMatchDescription(built.description, SearchPageEvents.recentQueryClick);
|
|
@@ -1283,8 +1316,8 @@ describe('SearchPageClient', () => {
|
|
|
1283
1316
|
});
|
|
1284
1317
|
|
|
1285
1318
|
it('should send proper payload for #makeClearRecentQueries', async () => {
|
|
1286
|
-
const built = client.makeClearRecentQueries();
|
|
1287
|
-
await built.log();
|
|
1319
|
+
const built = await client.makeClearRecentQueries();
|
|
1320
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1288
1321
|
|
|
1289
1322
|
expectMatchCustomEventPayload(SearchPageEvents.clearRecentQueries);
|
|
1290
1323
|
expectMatchDescription(built.description, SearchPageEvents.clearRecentQueries);
|
|
@@ -1299,8 +1332,8 @@ describe('SearchPageClient', () => {
|
|
|
1299
1332
|
});
|
|
1300
1333
|
|
|
1301
1334
|
it('should send proper payload for #makeRecentResultClick', async () => {
|
|
1302
|
-
const built = client.makeRecentResultClick(fakeDocInfo, fakeDocID);
|
|
1303
|
-
await built.log();
|
|
1335
|
+
const built = await client.makeRecentResultClick(fakeDocInfo, fakeDocID);
|
|
1336
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1304
1337
|
|
|
1305
1338
|
expectMatchCustomEventPayload(SearchPageEvents.recentResultClick, {
|
|
1306
1339
|
info: fakeDocInfo,
|
|
@@ -1319,8 +1352,8 @@ describe('SearchPageClient', () => {
|
|
|
1319
1352
|
});
|
|
1320
1353
|
|
|
1321
1354
|
it('should send proper payload for #makeNoResultsBack', async () => {
|
|
1322
|
-
const built = client.makeNoResultsBack();
|
|
1323
|
-
await built.log();
|
|
1355
|
+
const built = await client.makeNoResultsBack();
|
|
1356
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1324
1357
|
|
|
1325
1358
|
expectMatchPayload(SearchPageEvents.noResultsBack);
|
|
1326
1359
|
expectMatchDescription(built.description, SearchPageEvents.noResultsBack);
|
|
@@ -1332,8 +1365,8 @@ describe('SearchPageClient', () => {
|
|
|
1332
1365
|
});
|
|
1333
1366
|
|
|
1334
1367
|
it('should send proper payload for #makeClearRecentResults', async () => {
|
|
1335
|
-
const built = client.makeClearRecentResults();
|
|
1336
|
-
await built.log();
|
|
1368
|
+
const built = await client.makeClearRecentResults();
|
|
1369
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1337
1370
|
|
|
1338
1371
|
expectMatchCustomEventPayload(SearchPageEvents.clearRecentResults);
|
|
1339
1372
|
expectMatchDescription(built.description, SearchPageEvents.clearRecentResults);
|
|
@@ -1345,8 +1378,8 @@ describe('SearchPageClient', () => {
|
|
|
1345
1378
|
});
|
|
1346
1379
|
|
|
1347
1380
|
it('should send proper payload for #makeCustomEventWithType', async () => {
|
|
1348
|
-
const built = client.makeCustomEventWithType('foo', 'bar', {buzz: 'bazz'});
|
|
1349
|
-
await built.log();
|
|
1381
|
+
const built = await client.makeCustomEventWithType('foo', 'bar', {buzz: 'bazz'});
|
|
1382
|
+
await built.log({searchUID: provider.getSearchUID()});
|
|
1350
1383
|
|
|
1351
1384
|
expectMatchCustomEventWithTypePayload('foo', 'bar', {buzz: 'bazz'});
|
|
1352
1385
|
expectMatchDescription(built.description, 'foo' as SearchPageEvents, {buzz: 'bazz'});
|