@@ -161,7 +161,7 @@ describe('choseCohort', () => {
161
161
} ) ;
162
162
} ) ;
163
163
164
- fdescribe ( 'ABN pixels' , ( ) => {
164
+ describe ( 'ABN pixels' , ( ) => {
165
165
const feature = 'testFeature' ;
166
166
const subFeature = 'fooFeature' ;
167
167
const mockExperimentConfig = {
@@ -241,7 +241,7 @@ fdescribe('ABN pixels', () => {
241
241
expect ( pixelIntercept ) . toHaveBeenCalledTimes ( 2 ) ;
242
242
expect ( pixelRequests [ 1 ] ) . toContain ( 'conversionWindowDays=0&' ) ;
243
243
expect ( pixelRequests [ 1 ] ) . toContain ( 'value=1&' ) ;
244
- // TODO: pixel validation
244
+ expect ( pixelValidator . validateLivePixels ( experimentPixels [ 'experiment.metrics' ] , 'experiment.metrics' , pixelRequests [ 1 ] ) ) . toEqual ( [ ] ) ;
245
245
} ) ;
246
246
247
247
it ( 'onMetricTriggered can trigger multiple matching metrics' , ( ) => {
@@ -258,6 +258,8 @@ fdescribe('ABN pixels', () => {
258
258
. filter ( ( u ) => u . startsWith ( '/t/experiment_metrics_' ) )
259
259
. map ( ( u ) => new URLSearchParams ( u . split ( '?' ) [ 1 ] ) . get ( 'conversionWindowDays' ) ) ;
260
260
expect ( sentConversionWindows ) . toEqual ( [ '6' , '5-7' ] ) ;
261
+ expect ( pixelValidator . validateLivePixels ( experimentPixels [ 'experiment.metrics' ] , 'experiment.metrics' , pixelRequests [ 1 ] ) ) . toEqual ( [ ] ) ;
262
+ expect ( pixelValidator . validateLivePixels ( experimentPixels [ 'experiment.metrics' ] , 'experiment.metrics' , pixelRequests [ 2 ] ) ) . toEqual ( [ ] ) ;
261
263
} ) ;
262
264
263
265
it ( 'metric conversion window is inclusive of first and last days' , ( ) => {
@@ -277,6 +279,11 @@ fdescribe('ABN pixels', () => {
277
279
. filter ( ( u ) => u . startsWith ( '/t/experiment_metrics_' ) )
278
280
. map ( ( u ) => new URLSearchParams ( u . split ( '?' ) [ 1 ] ) . get ( 'conversionWindowDays' ) ) ;
279
281
expect ( sentConversionWindows ) . toEqual ( [ '5' , '5-7' , '7' , '5-7' ] ) ;
282
+ pixelRequests . forEach ( ( u ) => {
283
+ if ( u . startsWith ( '/t/experiment_metrics_' ) ) {
284
+ expect ( pixelValidator . validateLivePixels ( experimentPixels [ 'experiment.metrics' ] , 'experiment.metrics' , u ) ) . toEqual ( [ ] ) ;
285
+ }
286
+ } )
280
287
} ) ;
281
288
282
289
it ( 'metric value count applies to conversion window only' , ( ) => {
0 commit comments