@@ -34,6 +34,7 @@ import AudienceEvaluator from '../audience_evaluator';
34
34
import eventDispatcher from '../../event_processor/event_dispatcher/default_dispatcher.browser' ;
35
35
import * as jsonSchemaValidator from '../../utils/json_schema_validator' ;
36
36
import { getMockProjectConfigManager } from '../../tests/mock/mock_project_config_manager' ;
37
+ import { Value } from '../../utils/promise/operation_value' ;
37
38
38
39
import {
39
40
getTestProjectConfig ,
@@ -1207,10 +1208,10 @@ describe('lib/core/decision_service', function() {
1207
1208
var sandbox ;
1208
1209
var mockLogger = createLogger ( { logLevel : LOG_LEVEL . INFO } ) ;
1209
1210
var fakeDecisionResponseWithArgs ;
1210
- var fakeDecisionResponse = {
1211
- result : null ,
1211
+ var fakeDecisionResponse = Value . of ( 'sync' , {
1212
+ result : { } ,
1212
1213
reasons : [ ] ,
1213
- } ;
1214
+ } ) ;
1214
1215
var user ;
1215
1216
beforeEach ( function ( ) {
1216
1217
configObj = projectConfig . createProjectConfig ( cloneDeep ( testDataWithFeatures ) ) ;
@@ -1247,10 +1248,10 @@ describe('lib/core/decision_service', function() {
1247
1248
test_attribute : 'test_value' ,
1248
1249
} ,
1249
1250
} ) ;
1250
- fakeDecisionResponseWithArgs = {
1251
- result : 'variation' ,
1251
+ fakeDecisionResponseWithArgs = Value . of ( 'sync' , {
1252
+ result : { variationKey : 'variation' } ,
1252
1253
reasons : [ ] ,
1253
- } ;
1254
+ } ) ;
1254
1255
experiment = configObj . experimentIdMap [ '594098' ] ;
1255
1256
getVariationStub = sandbox . stub ( decisionServiceInstance , 'resolveVariation' ) ;
1256
1257
getVariationStub . returns ( fakeDecisionResponse ) ;
@@ -1316,10 +1317,10 @@ describe('lib/core/decision_service', function() {
1316
1317
optimizely : { } ,
1317
1318
userId : 'user1' ,
1318
1319
} ) ;
1319
- fakeDecisionResponseWithArgs = {
1320
- result : 'var' ,
1320
+ fakeDecisionResponseWithArgs = Value . of ( 'sync' , {
1321
+ result : { variationKey : 'var' } ,
1321
1322
reasons : [ ] ,
1322
- } ;
1323
+ } ) ;
1323
1324
getVariationStub = sandbox . stub ( decisionServiceInstance , 'resolveVariation' ) ;
1324
1325
getVariationStub . returns ( fakeDecisionResponseWithArgs ) ;
1325
1326
getVariationStub . withArgs ( configObj , 'exp_with_group' , user ) . returns ( fakeDecisionResponseWithArgs ) ;
@@ -1566,10 +1567,10 @@ describe('lib/core/decision_service', function() {
1566
1567
var feature ;
1567
1568
var getVariationStub ;
1568
1569
var bucketStub ;
1569
- fakeDecisionResponse = {
1570
- result : null ,
1570
+ fakeDecisionResponse = Value . of ( 'sync' , {
1571
+ result : { } ,
1571
1572
reasons : [ ] ,
1572
- } ;
1573
+ } ) ;
1573
1574
var fakeBucketStubDecisionResponse = {
1574
1575
result : '599057' ,
1575
1576
reasons : [ ] ,
0 commit comments