Skip to content

Commit 5b407d5

Browse files
committed
Add tests for getSendFlagDecisionsValue method
1 parent 0eb0ee2 commit 5b407d5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

packages/optimizely-sdk/lib/core/project_config/index.tests.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,32 @@ describe('lib/core/project_config', function() {
392392
});
393393
});
394394

395+
describe('#getSendFlagDecisionsValue', function() {
396+
it('should return false when sendFlagDecisions is undefined', function() {
397+
configObj.sendFlagDecisions = undefined;
398+
assert.deepEqual(
399+
projectConfig.getSendFlagDecisionsValue(configObj),
400+
false
401+
);
402+
});
403+
404+
it('should return false when sendFlagDecisions is set to false', function() {
405+
configObj.sendFlagDecisions = false;
406+
assert.deepEqual(
407+
projectConfig.getSendFlagDecisionsValue(configObj),
408+
false
409+
);
410+
});
411+
412+
it('should return true when sendFlagDecisions is set to true', function() {
413+
configObj.sendFlagDecisions = true;
414+
assert.deepEqual(
415+
projectConfig.getSendFlagDecisionsValue(configObj),
416+
true
417+
);
418+
});
419+
});
420+
395421
describe('feature management', function() {
396422
var featureManagementLogger = loggerPlugin.createLogger({ logLevel: LOG_LEVEL.INFO });
397423
beforeEach(function() {

0 commit comments

Comments
 (0)