File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed
Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -72,37 +72,6 @@ describe('Rules Module', function() {
7272 expect ( rulesets [ 0 ] . modelGroups [ 1 ] . selected ) . to . be . false ;
7373 } ) ;
7474
75- it ( 'should select last group if none selected by weights' , function ( ) {
76- const rulesets = [ {
77- name : 'testRuleSet' ,
78- stage : 'processed-auction-request' ,
79- modelGroups : [ {
80- weight : 10 ,
81- selected : false ,
82- analyticsKey : 'testKey1' ,
83- schema : [ ] ,
84- rules : [ ]
85- } , {
86- weight : 10 ,
87- selected : false ,
88- analyticsKey : 'testKey2' ,
89- schema : [ ] ,
90- rules : [ ]
91- } ]
92- } ] ;
93-
94- // Mock Math.random to return 1.0 so randomValue equals weightSum
95- // randomValue = 1.0 * 20 = 20
96- // First iteration: 20 < 10? no, randomValue -= 10 = 10
97- // Second iteration: 10 < 10? no, randomValue -= 10 = 0
98- // No group selected in loop, so last group should be selected as fallback
99- sandbox . stub ( Math , 'random' ) . returns ( 1.0 ) ;
100-
101- rulesModule . assignModelGroups ( rulesets ) ;
102-
103- expect ( rulesets [ 0 ] . modelGroups [ rulesets [ 0 ] . modelGroups . length - 1 ] . selected ) . to . be . true ;
104- } ) ;
105-
10675 it ( 'should use default weight of 100 when weight is not specified' , function ( ) {
10776 const rulesets = [ {
10877 name : 'testRuleSet' ,
You can’t perform that action at this time.
0 commit comments