@@ -14,21 +14,24 @@ const boostedCard = {
1414
1515describe ( 'FlexibleGeneral' , ( ) => {
1616 it ( 'Should return a one card half width row layout if one standard card is provided' , ( ) => {
17- expect ( decideCardPositions ( [ standardCard ] ) ) . toEqual ( [
17+ expect ( decideCardPositions ( [ standardCard ] , false ) ) . toEqual ( [
1818 {
1919 layout : 'oneCardHalfWidth' ,
2020 cards : [ standardCard ] ,
2121 } ,
2222 ] ) ;
2323 } ) ;
2424 it ( 'Should return a one card full width row layout if one boosted card is provided' , ( ) => {
25- expect ( decideCardPositions ( [ boostedCard ] ) ) . toEqual ( [
25+ expect ( decideCardPositions ( [ boostedCard ] , false ) ) . toEqual ( [
2626 { layout : 'oneCardFullWidth' , cards : [ boostedCard ] } ,
2727 ] ) ;
2828 } ) ;
2929 it ( 'Should return a one card full width row layout if one immersive card is provided' , ( ) => {
3030 expect (
31- decideCardPositions ( [ { ...standardCard , isImmersive : true } ] ) ,
31+ decideCardPositions (
32+ [ { ...standardCard , isImmersive : true } ] ,
33+ false ,
34+ ) ,
3235 ) . toEqual ( [
3336 {
3437 layout : 'oneCardFullWidth' ,
@@ -37,17 +40,17 @@ describe('FlexibleGeneral', () => {
3740 ] ) ;
3841 } ) ;
3942 it ( 'Should return a two card row layout if two standard cards are provided' , ( ) => {
40- expect ( decideCardPositions ( [ standardCard , standardCard ] ) ) . toEqual ( [
41- { layout : 'twoCard' , cards : [ standardCard , standardCard ] } ,
42- ] ) ;
43+ expect (
44+ decideCardPositions ( [ standardCard , standardCard ] , false ) ,
45+ ) . toEqual ( [ { layout : 'twoCard' , cards : [ standardCard , standardCard ] } ] ) ;
4346 } ) ;
4447
4548 it ( 'Should return a one card half width row layout if one card without boost level is provided' , ( ) => {
4649 const cardWithoutBoostLevel = {
4750 ...standardCard ,
4851 boostLevel : undefined ,
4952 } ;
50- expect ( decideCardPositions ( [ cardWithoutBoostLevel ] ) ) . toEqual ( [
53+ expect ( decideCardPositions ( [ cardWithoutBoostLevel ] , false ) ) . toEqual ( [
5154 {
5255 layout : 'oneCardHalfWidth' ,
5356 cards : [ cardWithoutBoostLevel ] ,
@@ -57,12 +60,10 @@ describe('FlexibleGeneral', () => {
5760
5861 it ( 'Should return two rows of two card row layouts if four standard cards are provided' , ( ) => {
5962 expect (
60- decideCardPositions ( [
61- standardCard ,
62- standardCard ,
63- standardCard ,
64- standardCard ,
65- ] ) ,
63+ decideCardPositions (
64+ [ standardCard , standardCard , standardCard , standardCard ] ,
65+ false ,
66+ ) ,
6667 ) . toEqual ( [
6768 { layout : 'twoCard' , cards : [ standardCard , standardCard ] } ,
6869 { layout : 'twoCard' , cards : [ standardCard , standardCard ] } ,
@@ -71,12 +72,10 @@ describe('FlexibleGeneral', () => {
7172
7273 it ( 'Should return three rows of expected row layouts if a boosted card and three standard cards are provided' , ( ) => {
7374 expect (
74- decideCardPositions ( [
75- boostedCard ,
76- standardCard ,
77- standardCard ,
78- standardCard ,
79- ] ) ,
75+ decideCardPositions (
76+ [ boostedCard , standardCard , standardCard , standardCard ] ,
77+ false ,
78+ ) ,
8079 ) . toEqual ( [
8180 { layout : 'oneCardFullWidth' , cards : [ boostedCard ] } ,
8281 { layout : 'twoCard' , cards : [ standardCard , standardCard ] } ,
@@ -86,12 +85,10 @@ describe('FlexibleGeneral', () => {
8685
8786 it ( 'Should return three rows of expected row layouts if a standard, then boosted card and two standard cards are provided' , ( ) => {
8887 expect (
89- decideCardPositions ( [
90- standardCard ,
91- boostedCard ,
92- standardCard ,
93- standardCard ,
94- ] ) ,
88+ decideCardPositions (
89+ [ standardCard , boostedCard , standardCard , standardCard ] ,
90+ false ,
91+ ) ,
9592 ) . toEqual ( [
9693 { layout : 'oneCardHalfWidth' , cards : [ standardCard ] } ,
9794 { layout : 'oneCardFullWidth' , cards : [ boostedCard ] } ,
0 commit comments