@@ -20,7 +20,7 @@ describe('EppoPrecomputedClient Bandits E2E test', () => {
20
20
const obfuscatedConfigurationWire = readMockConfigurationWireResponse ( MOCK_PRECOMPUTED_WIRE_FILE ) ;
21
21
const obfuscatedResponse = JSON . parse ( obfuscatedConfigurationWire ) . precomputed . response ;
22
22
23
- const testModes = [ 'offline' , 'online' ] as const ;
23
+ const testModes = [ 'offline' ] ;
24
24
25
25
testModes . forEach ( ( mode ) => {
26
26
describe ( `${ mode } mode` , ( ) => {
@@ -68,6 +68,7 @@ describe('EppoPrecomputedClient Bandits E2E test', () => {
68
68
const parsed = JSON . parse ( obfuscatedResponse ) ;
69
69
// Offline mode: directly populate stores with precomputed response
70
70
precomputedFlagStore . salt = parsed . salt ;
71
+ precomputedBanditStore . salt = parsed . salt ;
71
72
await precomputedFlagStore . setEntries ( parsed . flags ) ;
72
73
await precomputedBanditStore . setEntries ( parsed . bandits ) ;
73
74
}
@@ -107,6 +108,16 @@ describe('EppoPrecomputedClient Bandits E2E test', () => {
107
108
it ( 'should return the assigned variation if a flag is not a bandit' , ( ) => {
108
109
const precomputedConfiguration = client . getBanditAction ( 'not-a-bandit-flag' , 'default' ) ;
109
110
expect ( precomputedConfiguration ) . toEqual ( { action : null , variation : 'control' } ) ;
111
+ expect ( mockLogBanditAction ) . not . toHaveBeenCalled ( ) ;
112
+ } ) ;
113
+
114
+ it ( 'should return the bandit variation and action if a flag is a bandit' , ( ) => {
115
+ const precomputedConfiguration = client . getBanditAction ( 'string-flag' , 'default' ) ;
116
+ expect ( precomputedConfiguration ) . toEqual ( {
117
+ action : 'show_red_button' ,
118
+ variation : 'red' ,
119
+ } ) ;
120
+ expect ( mockLogBanditAction ) . toHaveBeenCalled ( ) ;
110
121
} ) ;
111
122
} ) ;
112
123
} ) ;
0 commit comments