Sha256: c10144568c7fdb5d51ec1ac05b7dc569a58b5677a8a22127d0f8cf5e1dc3106a
Contents?: true
Size: 1.16 KB
Versions: 70
Compression:
Stored size: 1.16 KB
Contents
describe('Service:FeatureFlag', function() { var FeatureFlag; beforeEach(module('Bastion.features')); beforeEach(module(function ($provide) { $provide.value('FeatureSettings', {'custom_products': false}); })); beforeEach(inject(function($injector) { FeatureFlag = $injector.get('FeatureFlag'); FeatureFlag.addStates('custom_products', ['products', 'products.new']); })); it("should allow checking if a feature is enabled", function () { expect(FeatureFlag.featureEnabled('custom_products')).toBe(false); }); it("should default to true if a feature is undefined", function () { expect(FeatureFlag.featureEnabled('fake_flag')).toBe(true); }); it("should allow checking if a state is enabled", function () { expect(FeatureFlag.stateEnabled('products')).toBe(false); expect(FeatureFlag.stateEnabled('products.fake')).toBe(true); }); it("should allow adding states to a feature", function () { expect(FeatureFlag.addStates('custom_products', ['products.new.form'])).toBe(FeatureFlag); expect(FeatureFlag.stateEnabled('products.new.form')).toBe(false); }); });
Version data entries
70 entries across 70 versions & 1 rubygems