* Add RailsEnvConstraint for routes * Add feature flags API * Add Cypress commands * Add show action, update commands, add e2e test * Update cypress/integration/seededFlows/toggleFeatureFlags.spec.js Co-authored-by: Suzanne Aitchison <suzanne@forem.com> * Move helper from command to test file * Update documentation Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
18 lines
540 B
JavaScript
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);
|
|
});
|
|
});
|