@@ -60,7 +60,7 @@ describe('PersonalizeMiddleware', () => {
60
60
} ,
61
61
cookies : {
62
62
get ( cookieName : string ) {
63
- const cookies = { 'bid_cdp -client-key' : 'browser-id' , ...props . cookieValues } ;
63
+ const cookies = { 'BID_cdp -client-key' : 'browser-id' , ...props . cookieValues } ;
64
64
65
65
return cookies [ cookieName ] ;
66
66
} ,
@@ -119,7 +119,7 @@ describe('PersonalizeMiddleware', () => {
119
119
) => {
120
120
const cdpConfig = {
121
121
clientKey : 'cdp-client-key' ,
122
- endpoint : 'http:// cdp-endpoint' ,
122
+ domain : 'cdp-endpoint' ,
123
123
pointOfSale : 'cdp-pos' ,
124
124
...( props ?. cdpConfig || { } ) ,
125
125
} ;
@@ -191,7 +191,7 @@ describe('PersonalizeMiddleware', () => {
191
191
192
192
validateDebugLog ( 'skipped (personalize middleware is disabled)' ) ;
193
193
194
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
194
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
195
195
196
196
expect ( finalRes ) . to . deep . equal ( res ) ;
197
197
@@ -216,7 +216,7 @@ describe('PersonalizeMiddleware', () => {
216
216
217
217
validateDebugLog ( 'skipped (%s)' , 'redirected' ) ;
218
218
219
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
219
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
220
220
221
221
expect ( finalRes ) . to . deep . equal ( res ) ;
222
222
@@ -246,7 +246,7 @@ describe('PersonalizeMiddleware', () => {
246
246
247
247
validateDebugLog ( 'skipped (%s)' , 'preview' ) ;
248
248
249
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
249
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
250
250
expect ( getCookiesSpy . calledWith ( '__prerender_bypass' ) ) . to . be . true ;
251
251
252
252
expect ( finalRes ) . to . deep . equal ( res ) ;
@@ -276,7 +276,7 @@ describe('PersonalizeMiddleware', () => {
276
276
277
277
validateDebugLog ( 'skipped (%s)' , 'preview' ) ;
278
278
279
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
279
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
280
280
expect ( getCookiesSpy . calledWith ( '__prerender_bypass' ) ) . to . be . true ;
281
281
expect ( getCookiesSpy . calledWith ( '__next_preview_data' ) ) . to . be . true ;
282
282
@@ -307,7 +307,7 @@ describe('PersonalizeMiddleware', () => {
307
307
308
308
validateDebugLog ( 'skipped (%s)' , 'route excluded' ) ;
309
309
310
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
310
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
311
311
312
312
expect ( finalRes ) . to . deep . equal ( res ) ;
313
313
@@ -355,7 +355,7 @@ describe('PersonalizeMiddleware', () => {
355
355
356
356
validateDebugLog ( 'skipped (personalize info not found)' ) ;
357
357
358
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
358
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
359
359
360
360
expect ( finalRes ) . to . deep . equal ( res ) ;
361
361
@@ -387,7 +387,7 @@ describe('PersonalizeMiddleware', () => {
387
387
388
388
validateDebugLog ( 'skipped (no personalization configured)' ) ;
389
389
390
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
390
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
391
391
392
392
expect ( finalRes ) . to . deep . equal ( res ) ;
393
393
@@ -396,7 +396,7 @@ describe('PersonalizeMiddleware', () => {
396
396
397
397
it ( 'browser id generation failed' , async ( ) => {
398
398
const req = createRequest ( {
399
- cookieValues : { 'bid_cdp -client-key' : undefined } ,
399
+ cookieValues : { 'BID_cdp -client-key' : undefined } ,
400
400
} ) ;
401
401
402
402
const res = createResponse ( ) ;
@@ -420,7 +420,7 @@ describe('PersonalizeMiddleware', () => {
420
420
421
421
validateDebugLog ( 'skipped (browser id generation failed)' ) ;
422
422
423
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
423
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
424
424
425
425
expect ( finalRes ) . to . deep . equal ( res ) ;
426
426
@@ -451,7 +451,7 @@ describe('PersonalizeMiddleware', () => {
451
451
452
452
validateDebugLog ( 'skipped (no variant identified)' ) ;
453
453
454
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
454
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
455
455
456
456
expect ( finalRes ) . to . deep . equal ( res ) ;
457
457
@@ -482,7 +482,7 @@ describe('PersonalizeMiddleware', () => {
482
482
483
483
validateDebugLog ( 'skipped (invalid variant)' ) ;
484
484
485
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
485
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
486
486
487
487
expect ( finalRes ) . to . deep . equal ( res ) ;
488
488
@@ -494,7 +494,7 @@ describe('PersonalizeMiddleware', () => {
494
494
it ( 'browser id is present in cookies' , async ( ) => {
495
495
const req = createRequest ( {
496
496
cookieValues : {
497
- 'bid_cdp -client-key' : 'browser-id' ,
497
+ 'BID_cdp -client-key' : 'browser-id' ,
498
498
} ,
499
499
} ) ;
500
500
@@ -527,11 +527,11 @@ describe('PersonalizeMiddleware', () => {
527
527
} ,
528
528
} ) ;
529
529
530
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
530
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
531
531
532
532
expect ( finalRes ) . to . deep . equal ( res ) ;
533
533
534
- expect ( finalRes . cookies [ 'bid_cdp -client-key' ] ) . to . equal ( browserId ) ;
534
+ expect ( finalRes . cookies [ 'BID_cdp -client-key' ] ) . to . equal ( browserId ) ;
535
535
536
536
getCookiesSpy . restore ( ) ;
537
537
nextRewriteStub . restore ( ) ;
@@ -540,7 +540,7 @@ describe('PersonalizeMiddleware', () => {
540
540
it ( 'browser id is not present in cookies' , async ( ) => {
541
541
const req = createRequest ( {
542
542
cookieValues : {
543
- 'bid_cdp -client-key' : undefined ,
543
+ 'BID_cdp -client-key' : undefined ,
544
544
} ,
545
545
} ) ;
546
546
@@ -581,11 +581,11 @@ describe('PersonalizeMiddleware', () => {
581
581
} ,
582
582
} ) ;
583
583
584
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
584
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
585
585
586
586
expect ( finalRes ) . to . deep . equal ( res ) ;
587
587
588
- expect ( finalRes . cookies [ 'bid_cdp -client-key' ] ) . to . equal ( browserId ) ;
588
+ expect ( finalRes . cookies [ 'BID_cdp -client-key' ] ) . to . equal ( browserId ) ;
589
589
590
590
getCookiesSpy . restore ( ) ;
591
591
nextRewriteStub . restore ( ) ;
@@ -634,11 +634,11 @@ describe('PersonalizeMiddleware', () => {
634
634
} ,
635
635
} ) ;
636
636
637
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
637
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
638
638
639
639
expect ( finalRes ) . to . deep . equal ( res ) ;
640
640
641
- expect ( finalRes . cookies [ 'bid_cdp -client-key' ] ) . to . equal ( browserId ) ;
641
+ expect ( finalRes . cookies [ 'BID_cdp -client-key' ] ) . to . equal ( browserId ) ;
642
642
643
643
getCookiesSpy . restore ( ) ;
644
644
nextRewriteStub . restore ( ) ;
@@ -681,11 +681,11 @@ describe('PersonalizeMiddleware', () => {
681
681
} ,
682
682
} ) ;
683
683
684
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
684
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
685
685
686
686
expect ( finalRes ) . to . deep . equal ( res ) ;
687
687
688
- expect ( finalRes . cookies [ 'bid_cdp -client-key' ] ) . to . equal ( browserId ) ;
688
+ expect ( finalRes . cookies [ 'BID_cdp -client-key' ] ) . to . equal ( browserId ) ;
689
689
690
690
getCookiesSpy . restore ( ) ;
691
691
nextRewriteStub . restore ( ) ;
@@ -723,11 +723,11 @@ describe('PersonalizeMiddleware', () => {
723
723
} ,
724
724
} ) ;
725
725
726
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
726
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
727
727
728
728
expect ( finalRes ) . to . deep . equal ( res ) ;
729
729
730
- expect ( finalRes . cookies [ 'bid_cdp -client-key' ] ) . to . equal ( browserId ) ;
730
+ expect ( finalRes . cookies [ 'BID_cdp -client-key' ] ) . to . equal ( browserId ) ;
731
731
732
732
getCookiesSpy . restore ( ) ;
733
733
nextRewriteStub . restore ( ) ;
@@ -777,11 +777,11 @@ describe('PersonalizeMiddleware', () => {
777
777
} ,
778
778
} ) ;
779
779
780
- expect ( getCookiesSpy . calledWith ( 'bid_cdp -client-key' ) ) . to . be . true ;
780
+ expect ( getCookiesSpy . calledWith ( 'BID_cdp -client-key' ) ) . to . be . true ;
781
781
782
782
expect ( finalRes ) . to . deep . equal ( res ) ;
783
783
784
- expect ( finalRes . cookies [ 'bid_cdp -client-key' ] ) . to . equal ( browserId ) ;
784
+ expect ( finalRes . cookies [ 'BID_cdp -client-key' ] ) . to . equal ( browserId ) ;
785
785
786
786
getCookiesSpy . restore ( ) ;
787
787
nextRewriteStub . restore ( ) ;
@@ -826,7 +826,7 @@ describe('PersonalizeMiddleware', () => {
826
826
it ( 'should log error when generateBrowserId throws' , async ( ) => {
827
827
const error = new Error ( 'CDP generateBrowserId fails' ) ;
828
828
const req = createRequest ( {
829
- cookieValues : { 'bid_cdp -client-key' : undefined } ,
829
+ cookieValues : { 'BID_cdp -client-key' : undefined } ,
830
830
} ) ;
831
831
832
832
const generateBrowserIdWithError = sinon . stub ( ) . throws ( error ) ;
0 commit comments