mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
chore: validate import data using api (#5848)
Use the admin api to validate the feature toggle that has been imported. This hopefully makes the test less fragile as we do not depend on the frontend to validate the import.
This commit is contained in:
parent
2bff3f010b
commit
623b9b127f
@ -115,17 +115,18 @@ describe('imports', () => {
|
|||||||
|
|
||||||
cy.wait(1500);
|
cy.wait(1500);
|
||||||
|
|
||||||
cy.visit(`/projects/default/features/${randomFeatureName}`);
|
cy.request({
|
||||||
|
url: `/api/admin/projects/default/features/${randomFeatureName}`,
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
}).then((response) => {
|
||||||
|
expect(response.body.name).to.equal(randomFeatureName);
|
||||||
|
const devEnv = response.body.environments.find(
|
||||||
|
(env: any) => env.name === 'development',
|
||||||
|
);
|
||||||
|
|
||||||
cy.get(
|
expect(devEnv.name).to.equal('development');
|
||||||
"[data-testid='feature-toggle-status'] input[type='checkbox']:checked",
|
expect(devEnv.strategies[0].parameters.rollout).to.equal('50');
|
||||||
)
|
expect(devEnv.enabled).to.equal(true);
|
||||||
.invoke('attr', 'aria-label')
|
});
|
||||||
.should('eq', 'development');
|
|
||||||
|
|
||||||
cy.get(
|
|
||||||
'[data-testid="FEATURE_ENVIRONMENT_ACCORDION_development"]',
|
|
||||||
).click();
|
|
||||||
cy.contains('50%');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user