docbrown/cypress/e2e/seededFlows/toggleFeatureFlags.spec.js
dependabot[bot] deb86efb0d
Bump cypress and @knapsack-pro/cypress (#18025)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-07-06 17:53:13 -04:00

18 lines
540 B
JavaScript

describe('Toggling feature flags', () => {
function checkFeatureFlag(flag, expected) {
return cy
.request('GET', `/api/feature_flags?flag=${flag}`)
.should((response) => {
expect(response.body).to.deep.equal({ [flag]: expected });
});
}
it('toggles and verifies feature flags', () => {
const flag = 'test_feature_flag';
checkFeatureFlag(flag, false);
cy.enableFeatureFlag(flag);
checkFeatureFlag(flag, true);
cy.disableFeatureFlag(flag);
checkFeatureFlag(flag, false);
});
});