@@ -82,7 +82,7 @@ test("calculateSpaceUpdates - handles empty audience space and tests", () => {
8282 const emptyAudienceSpace = new Map < string , FastlyTestParams > ( ) ;
8383 const emptyTests : ABTest [ ] = [ ] ;
8484
85- const result = calculateSpaceUpdates ( emptyAudienceSpace , emptyTests ) ;
85+ const result = calculateSpaceUpdates ( "A" , emptyAudienceSpace , emptyTests ) ;
8686
8787 equal ( result . size , 0 ) ;
8888 equal ( deleteTestGroupSpy . mock . callCount ( ) , 0 ) ;
@@ -99,7 +99,7 @@ test("calculateSpaceUpdates - adds new test groups correctly", () => {
9999 } ) ,
100100 ] ;
101101
102- const result = calculateSpaceUpdates ( emptyAudienceSpace , tests ) ;
102+ const result = calculateSpaceUpdates ( "A" , emptyAudienceSpace , tests ) ;
103103
104104 // Should have 2 MVT entries (one for each group)
105105 equal ( result . size , 2 ) ;
@@ -137,7 +137,7 @@ test("calculateSpaceUpdates - removes tests no longer present", () => {
137137 } ) ,
138138 ] ;
139139
140- const result = calculateSpaceUpdates ( existingAudienceSpace , tests ) ;
140+ const result = calculateSpaceUpdates ( "A" , existingAudienceSpace , tests ) ;
141141
142142 // Should only have entries for test1
143143 const testNames = new Set (
@@ -166,7 +166,7 @@ test("calculateSpaceUpdates - resizes existing test groups", () => {
166166 } ) ,
167167 ] ;
168168
169- const result = calculateSpaceUpdates ( existingAudienceSpace , tests ) ;
169+ const result = calculateSpaceUpdates ( "A" , existingAudienceSpace , tests ) ;
170170
171171 // Should have 4 MVT entries total (2 per group)
172172 equal ( result . size , 4 ) ;
@@ -189,7 +189,7 @@ test("calculateSpaceUpdates - handles fractional audience sizes correctly", () =
189189 } ) ,
190190 ] ;
191191
192- const result = calculateSpaceUpdates ( emptyAudienceSpace , tests ) ;
192+ const result = calculateSpaceUpdates ( "A" , emptyAudienceSpace , tests ) ;
193193
194194 // With 0.004 audience size and 2 groups, each group gets 0.002 * 1000 = 2 MVTs
195195 equal ( result . size , 4 ) ; // 2 * 2 groups
@@ -208,7 +208,7 @@ test("calculateSpaceUpdates - handles single group test", () => {
208208 } ) ,
209209 ] ;
210210
211- const result = calculateSpaceUpdates ( emptyAudienceSpace , tests ) ;
211+ const result = calculateSpaceUpdates ( "A" , emptyAudienceSpace , tests ) ;
212212
213213 // All audience size goes to the single group
214214 equal ( result . size , 2 ) ; // 0.002 * 1000 = 2 MVTs
@@ -234,7 +234,7 @@ test("calculateSpaceUpdates - handles multiple tests", () => {
234234 } ) ,
235235 ] ;
236236
237- const result = calculateSpaceUpdates ( emptyAudienceSpace , tests ) ;
237+ const result = calculateSpaceUpdates ( "A" , emptyAudienceSpace , tests ) ;
238238
239239 // test1: 2 MVTs (1 per group), test2: 1 MVT = 3 total
240240 equal ( result . size , 3 ) ;
@@ -263,7 +263,7 @@ test("calculateSpaceUpdates - preserves expiration dates", () => {
263263 } ) ,
264264 ] ;
265265
266- const result = calculateSpaceUpdates ( emptyAudienceSpace , tests ) ;
266+ const result = calculateSpaceUpdates ( "A" , emptyAudienceSpace , tests ) ;
267267
268268 const entry = result . get ( "mvt:0" ) ;
269269 equal ( entry ?. exp , Math . floor ( new Date ( expirationDate ) . getTime ( ) / 1000 ) ) ;
@@ -283,7 +283,7 @@ test("calculateSpaceUpdates - handles client-side tests", () => {
283283 } ) ,
284284 ] ;
285285
286- const result = calculateSpaceUpdates ( emptyAudienceSpace , tests ) ;
286+ const result = calculateSpaceUpdates ( "A" , emptyAudienceSpace , tests ) ;
287287
288288 const entry = result . get ( "mvt:0" ) ;
289289 equal ( entry ?. type , "client" ) ;
@@ -475,7 +475,7 @@ test("calculateSpaceUpdates - resizes middle test with adjacent tests", () => {
475475 } ) ,
476476 ] ;
477477
478- const result = calculateSpaceUpdates ( existingAudienceSpace , tests ) ;
478+ const result = calculateSpaceUpdates ( "A" , existingAudienceSpace , tests ) ;
479479
480480 // Should have 14 MVT entries total (4 + 6 + 4)
481481 equal ( result . size , 14 ) ;
@@ -559,7 +559,7 @@ test("calculateSpaceUpdates - shrinks middle test with adjacent tests", () => {
559559 } ) ,
560560 ] ;
561561
562- const result = calculateSpaceUpdates ( existingAudienceSpace , tests ) ;
562+ const result = calculateSpaceUpdates ( "A" , existingAudienceSpace , tests ) ;
563563
564564 // Should have 10 MVT entries total (4 + 2 + 4)
565565 equal ( result . size , 10 ) ;
@@ -611,7 +611,7 @@ test("calculateSpaceUpdates - dividing tests into non integer group sizes should
611611 } ) ,
612612 ] ;
613613
614- const result = calculateSpaceUpdates ( existingAudienceSpace , tests ) ;
614+ const result = calculateSpaceUpdates ( "A" , existingAudienceSpace , tests ) ;
615615
616616 // Should have 198 MVT entries total
617617 equal ( result . size , 198 ) ;
@@ -686,7 +686,7 @@ test("calculateSpaceUpdates - handles insufficient MVTs when resizing middle tes
686686 // This should throw an error because there aren't enough available MVTs
687687 // to resize test2 from 4 MVTs to 20 MVTs (needs 16 additional MVTs but only 6 are available)
688688 throws (
689- ( ) => calculateSpaceUpdates ( existingAudienceSpace , tests ) ,
689+ ( ) => calculateSpaceUpdates ( "A" , existingAudienceSpace , tests ) ,
690690 Error ,
691691 "Not enough available MVTs for test commercial-test2:control" ,
692692 ) ;
@@ -710,7 +710,7 @@ test("calculateSpaceUpdates - updates expiration date for existing test", () =>
710710 } ) ,
711711 ] ;
712712
713- const result = calculateSpaceUpdates ( existingAudienceSpace , tests ) ;
713+ const result = calculateSpaceUpdates ( "A" , existingAudienceSpace , tests ) ;
714714
715715 // Check that all entries have the updated expiration date
716716 const controlEntry = result . get ( "mvt:0" ) ;
@@ -756,7 +756,7 @@ test("calculateSpaceUpdates - handles status change from ON to OFF by removing t
756756 } ) ,
757757 ] ;
758758
759- const result = calculateSpaceUpdates ( existingAudienceSpace , tests ) ;
759+ const result = calculateSpaceUpdates ( "A" , existingAudienceSpace , tests ) ;
760760
761761 // Should only have entries for test1
762762 const testNames = new Set (
@@ -793,7 +793,7 @@ test("calculateSpaceUpdates - handles status change from OFF to ON by adding tes
793793 } ) ,
794794 ] ;
795795
796- const result = calculateSpaceUpdates ( existingAudienceSpace , tests ) ;
796+ const result = calculateSpaceUpdates ( "A" , existingAudienceSpace , tests ) ;
797797
798798 // Should have entries for both tests
799799 const testNames = new Set (
@@ -827,7 +827,7 @@ test("calculateSpaceUpdates - updates both expiration and size simultaneously",
827827 } ) ,
828828 ] ;
829829
830- const result = calculateSpaceUpdates ( existingAudienceSpace , tests ) ;
830+ const result = calculateSpaceUpdates ( "A" , existingAudienceSpace , tests ) ;
831831
832832 // Should have 4 MVT entries (2 per group) instead of 2
833833 equal ( result . size , 4 ) ;
0 commit comments