Skip to content

Commit db69636

Browse files
[FSSDK-10766] assertion update + copyright update
1 parent c4d3f0d commit db69636

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

lib/core/decision_service/index.tests.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* Copyright 2017-2022 Optimizely, Inc. and contributors *
2+
* Copyright 2017-2022,2024 Optimizely, Inc. and contributors *
33
* *
44
* Licensed under the Apache License, Version 2.0 (the "License"); *
55
* you may not use this file except in compliance with the License. *
@@ -392,20 +392,21 @@ describe('lib/core/decision_service', function() {
392392
optimizely: {},
393393
userId: 'decision_service_user',
394394
});
395+
395396
assert.strictEqual(
396397
'control',
397398
decisionServiceInstance.getVariation(configObj, experiment, user).result
398399
);
399400
sinon.assert.calledWith(userProfileLookupStub, 'decision_service_user');
400401
sinon.assert.calledOnce(bucketerStub); // should still go through with bucketing
401-
assert.strictEqual(
402-
buildLogMessageFromArgs(mockLogger.log.args[1]),
403-
'DECISION_SERVICE: User decision_service_user is not in the forced variation map.'
404-
);
405402
assert.strictEqual(
406403
buildLogMessageFromArgs(mockLogger.log.args[0]),
407404
'DECISION_SERVICE: Error while looking up user profile for user ID "decision_service_user": I am an error.'
408405
);
406+
assert.strictEqual(
407+
buildLogMessageFromArgs(mockLogger.log.args[1]),
408+
'DECISION_SERVICE: User decision_service_user is not in the forced variation map.'
409+
);
409410
});
410411

411412
it('should log an error message if "save" throws an error', function() {

lib/core/decision_service/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* Copyright 2017-2022 Optimizely, Inc. and contributors *
2+
* Copyright 2017-2022,2024 Optimizely, Inc. and contributors *
33
* *
44
* Licensed under the Apache License, Version 2.0 (the "License"); *
55
* you may not use this file except in compliance with the License. *

lib/optimizely/index.tests.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5926,6 +5926,7 @@ describe('lib/optimizely', function() {
59265926

59275927
sinon.stub(optlyInstance.decisionService.userProfileService, 'lookup')
59285928
sinon.stub(optlyInstance.decisionService.userProfileService, 'save')
5929+
//
59295930
});
59305931

59315932
it('Should call UPS methods only once', function() {
@@ -5956,13 +5957,24 @@ describe('lib/optimizely', function() {
59565957
userContext: user,
59575958
reasons: [],
59585959
};
5960+
var userProfile = {
5961+
user_id: userId,
5962+
experiment_bucket_map: {
5963+
'10420810910': { // ruleKey from expectedDecision1
5964+
variation_id: '10418551353' // variationKey from expectedDecision1
5965+
}
5966+
}
5967+
};
59595968

59605969
assert.deepEqual(Object.values(decisionsMap).length, 2);
59615970
assert.deepEqual(decision1, expectedDecision1);
59625971
assert.deepEqual(decision2, expectedDecision2);
59635972
// UPS batch assertion
59645973
sinon.assert.calledOnce(optlyInstance.decisionService.userProfileService.lookup);
59655974
sinon.assert.calledOnce(optlyInstance.decisionService.userProfileService.save);
5975+
5976+
// UPS save assertion
5977+
sinon.assert.calledWithExactly(optlyInstance.decisionService.userProfileService.save, userProfile);
59665978
});
59675979
})
59685980

lib/optimizely_user_context/index.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* Copyright 2020-2023, Optimizely, Inc. and contributors *
2+
* Copyright 2020-2024, Optimizely, Inc. and contributors *
33
* *
44
* Licensed under the Apache License, Version 2.0 (the "License"); *
55
* you may not use this file except in compliance with the License. *

0 commit comments

Comments
 (0)