Skip to content

Commit

Permalink
feat: Enforce one dependency (#4835)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Sep 26, 2023
1 parent e030b67 commit 76a2ec5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export class DependentFeaturesStore implements IDependentFeaturesStore {
featureDependency.variants,
);
}
// TODO: remove when we support multiple parents
await this.db('dependent_features')
.where('child', featureDependency.child)
.del();

await this.db('dependent_features')
.insert(serializableFeatureDependency)
.onConflict(['parent', 'child'])
Expand Down
9 changes: 0 additions & 9 deletions src/test/e2e/api/client/feature.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ beforeAll(async () => {
'featureY',
{ feature: 'featureX', variants: ['featureXVariant'] },
);
// depend on parent being disabled
await app.services.dependentFeaturesService.upsertFeatureDependency(
'featureY',
{ feature: 'featureZ', enabled: false },
);

await app.services.featureToggleServiceV2.archiveToggle(
'featureArchivedX',
Expand Down Expand Up @@ -154,10 +149,6 @@ test('returns dependencies', async () => {
enabled: true,
variants: ['featureXVariant'],
},
{
feature: 'featureZ',
enabled: false,
},
],
});
expect(res.body.features[1].dependencies).toBe(undefined);
Expand Down

0 comments on commit 76a2ec5

Please sign in to comment.