Skip to content

Add feature toggleability at the variation level. #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2018

Conversation

mikeproeng37
Copy link
Contributor

This introduces toggleability for a feature flag at the variation level.

assert.isFunction(callArgs[1]);
sinon.assert.calledWith(createdLogger.log, LOG_LEVEL.INFO, 'OPTIMIZELY: Feature test_feature_for_experiment is enabled for user user1.');
});
it('returns true and dispatches an impression event', function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these test cases were actually just moved into the describe clause for when the variation is toggled ON on line 2495.

var result = optlyInstance.isFeatureEnabled('test_feature_for_experiment');
assert.strictEqual(result, false);
sinon.assert.notCalled(eventDispatcher.dispatchEvent);
describe('when the variation is toggled OFF', function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the new test cases being added

experiment: experiment,
variation: variation,
decisionSource: DECISION_SOURCES.ROLLOUT,
describe('when the variation is toggled ON', function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are also new test cases

it('returns true and does not dispatch an event', function() {
var result = optlyInstance.isFeatureEnabled('test_feature', 'user1', {
test_attribute: 'test_value',
describe('when the variation is toggled OFF', function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New test cases

@coveralls
Copy link

coveralls commented Feb 8, 2018

Coverage Status

Coverage increased (+0.02%) to 97.96% when pulling d4c09d9 on mng/add-variation-level-toggleability into 2e7b9b2 on master.

@mikeproeng37 mikeproeng37 changed the base branch from 2.0-consolidation to master February 15, 2018 18:23
@mikeproeng37 mikeproeng37 force-pushed the mng/add-variation-level-toggleability branch from 8a1d43b to d4c09d9 Compare February 15, 2018 18:31
@mikeproeng37
Copy link
Contributor Author

build

3 similar comments
@mikeproeng37
Copy link
Contributor Author

build

@mikeproeng37
Copy link
Contributor Author

build

@mikeproeng37
Copy link
Contributor Author

build

@mjc1283 mjc1283 self-requested a review February 15, 2018 21:43
@mikeproeng37 mikeproeng37 merged commit 5cf29fc into master Feb 15, 2018
@wangjoshuah wangjoshuah deleted the mng/add-variation-level-toggleability branch February 15, 2018 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants