@@ -224,6 +224,7 @@ describe('enhanceProductSummary', () => {
224224 pageId : allowedPageId ,
225225 serverSideABTests : { 'thefilter-at-a-glance-redesign' : 'carousel' } ,
226226 renderingTarget : 'Web' ,
227+ filterAtAGlanceEnabled : true ,
227228 } ) ( input ) ;
228229
229230 const carousel = findCarousel ( output ) ;
@@ -265,6 +266,7 @@ describe('enhanceProductSummary', () => {
265266 pageId : allowedPageId ,
266267 serverSideABTests : { 'thefilter-at-a-glance-redesign' : 'stacked' } ,
267268 renderingTarget : 'Web' ,
269+ filterAtAGlanceEnabled : true ,
268270 } ) ( input ) ;
269271
270272 const stacked = findStacked ( output ) ;
@@ -306,6 +308,49 @@ describe('enhanceProductSummary', () => {
306308 pageId : allowedPageId ,
307309 serverSideABTests : { 'thefilter-at-a-glance-redesign' : 'stacked' } ,
308310 renderingTarget : 'Apps' ,
311+ filterAtAGlanceEnabled : true ,
312+ } ) ( input ) ;
313+
314+ const stacked = findStacked ( output ) ;
315+
316+ expect ( stacked ) . toBeUndefined ( ) ;
317+ } ) ;
318+
319+ it ( 'does not return stacked cards when the filterAtAGlance switch is OFF' , ( ) => {
320+ const allowedPageId =
321+ 'thefilter/test-article-example-for-product-summary' ;
322+
323+ const input = [
324+ atAGlanceHeading ( ) ,
325+ linkElement (
326+ 'https://www.homebase.co.uk/en-uk/tower-airx-t17166-5l-grey-single-basket-air-fryer-digital-air-fryer/p/0757395' ,
327+ 'Buy now' ,
328+ ) ,
329+ linkElement (
330+ 'https://www.lakeland.co.uk/27537/lakeland-slimline-air-fryer-black-8l' ,
331+ 'Buy now' ,
332+ ) ,
333+ linkElement (
334+ 'https://ninjakitchen.co.uk/product/ninja-double-stack-xl-9-5l-air-fryer-sl400uk-zidSL400UK' ,
335+ 'Buy now' ,
336+ ) ,
337+ dividerElement ( ) ,
338+ productElement ( [
339+ 'https://www.homebase.co.uk/en-uk/tower-airx-t17166-5l-grey-single-basket-air-fryer-digital-air-fryer/p/0757395' ,
340+ ] ) ,
341+ productElement ( [
342+ 'https://www.lakeland.co.uk/27537/lakeland-slimline-air-fryer-black-8l' ,
343+ ] ) ,
344+ productElement ( [
345+ 'https://ninjakitchen.co.uk/product/ninja-double-stack-xl-9-5l-air-fryer-sl400uk-zidSL400UK' ,
346+ ] ) ,
347+ ] ;
348+
349+ const output = enhanceProductSummary ( {
350+ pageId : allowedPageId ,
351+ serverSideABTests : { 'thefilter-at-a-glance-redesign' : 'stacked' } ,
352+ renderingTarget : 'Web' ,
353+ filterAtAGlanceEnabled : false ,
309354 } ) ( input ) ;
310355
311356 const stacked = findStacked ( output ) ;
0 commit comments