You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert.strictEqual(mockLogger.log.args[0][1],'PROJECT_CONFIG: User decision_service_user is not in the forced variation map.');
296
+
assert.strictEqual(mockLogger.log.args[1][1],'DECISION_SERVICE: Returning previously activated variation \"variation\" of experiment \"testExperiment\" for user \"decision_service_user\" from user profile.');
297
+
});
298
+
299
+
it('should ignore attributes for a different experiment id',function(){
300
+
userProfileLookupStub.returns({
301
+
user_id: 'decision_service_user',
302
+
experiment_bucket_map: {
303
+
'111127': {// 'testExperiment' ID
304
+
'variation_id': '111128'// ID of the 'control' variation
305
+
},
306
+
},
307
+
});
308
+
309
+
varattributes={
310
+
$opt_experiment_bucket_map: {
311
+
'122227': {// other experiment ID
312
+
'variation_id': '122229'// ID of the 'variationWithAudience' variation
assert.strictEqual(mockLogger.log.args[0][1],'PROJECT_CONFIG: User decision_service_user is not in the forced variation map.');
321
+
assert.strictEqual(mockLogger.log.args[1][1],'DECISION_SERVICE: Returning previously activated variation \"control\" of experiment \"testExperiment\" for user \"decision_service_user\" from user profile.');
322
+
});
323
+
324
+
it('should use attributes when the userProfileLookup variations for other experiments',function(){
325
+
userProfileLookupStub.returns({
326
+
user_id: 'decision_service_user',
327
+
experiment_bucket_map: {
328
+
'122227': {// other experiment ID
329
+
'variation_id': '122229'// ID of the 'variationWithAudience' variation
330
+
},
331
+
}
332
+
});
333
+
334
+
varattributes={
335
+
$opt_experiment_bucket_map: {
336
+
'111127': {// 'testExperiment' ID
337
+
'variation_id': '111129'// ID of the 'variation' variation
assert.strictEqual(mockLogger.log.args[0][1],'PROJECT_CONFIG: User decision_service_user is not in the forced variation map.');
346
+
assert.strictEqual(mockLogger.log.args[1][1],'DECISION_SERVICE: Returning previously activated variation \"variation\" of experiment \"testExperiment\" for user \"decision_service_user\" from user profile.');
347
+
});
348
+
349
+
it('should use attributes when the userProfileLookup returns null',function(){
350
+
userProfileLookupStub.returns(null);
351
+
352
+
varattributes={
353
+
$opt_experiment_bucket_map: {
354
+
'111127': {
355
+
'variation_id': '111129'// ID of the 'variation' variation
assert.strictEqual(mockLogger.log.args[0][1],'PROJECT_CONFIG: User decision_service_user is not in the forced variation map.');
364
+
assert.strictEqual(mockLogger.log.args[1][1],'DECISION_SERVICE: Returning previously activated variation \"variation\" of experiment \"testExperiment\" for user \"decision_service_user\" from user profile.');
0 commit comments