mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
feat: Enforce one dependency (#4835)
This commit is contained in:
parent
e030b67a19
commit
76a2ec53f1
@ -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'])
|
||||
|
@ -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',
|
||||
@ -154,10 +149,6 @@ test('returns dependencies', async () => {
|
||||
enabled: true,
|
||||
variants: ['featureXVariant'],
|
||||
},
|
||||
{
|
||||
feature: 'featureZ',
|
||||
enabled: false,
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(res.body.features[1].dependencies).toBe(undefined);
|
||||
|
Loading…
Reference in New Issue
Block a user