Skip to content

Commit

Permalink
Fixes the feature crud test for dev orgs (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijetmahabaleshwar-okta authored Jul 9, 2020
1 parent f18ef41 commit 3de9b14
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/it/feature-crud.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ describe('Feature Crud API', () => {
let firstFeatureInList;
let initialStatus;
beforeEach(async () => {
firstFeatureInList = (await client.listFeatures().next()).value;
// Disabling a BETA feature in a dev org throws 405 error
// Hence we need a non-BETA feature for testing
await client.listFeatures().each((feature) => {
if (feature.stage.value !== 'BETA') {
firstFeatureInList = feature;
return false;
}
});

if (firstFeatureInList) {
initialStatus = firstFeatureInList.status;
}
Expand Down Expand Up @@ -75,7 +83,12 @@ describe('Feature Crud API', () => {
describe('List feature dependencies', () => {
let firstFeatureInList;
beforeEach(async () => {
firstFeatureInList = (await client.listFeatures().next()).value;
await client.listFeatures().each((feature) => {
if (feature.stage.value !== 'BETA') {
firstFeatureInList = feature;
return false;
}
});
});

it('should return a collection of Features', async () => {
Expand Down

0 comments on commit 3de9b14

Please sign in to comment.