1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

fix: make default for gradual rollout work on the correct strategy name (#7401)

This commit is contained in:
Simon Hornby 2024-06-14 15:54:00 +02:00 committed by GitHub
parent c33901b332
commit 4eaa1525a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 6 deletions

View File

@ -25,7 +25,11 @@ const apiClientResponse = [
{
name: 'flexibleRollout',
constraints: [],
parameters: { rollout: '100' },
parameters: {
rollout: '100',
stickiness: 'default',
groupId: 'test1',
},
variants: [],
},
],
@ -169,7 +173,11 @@ test('should return correct data structure from /api/client/features', async ()
{
name: 'flexibleRollout',
constraints: [],
parameters: { rollout: '100' },
parameters: {
rollout: '100',
stickiness: 'default',
groupId: 'test1',
},
},
DEFAULT_ENV,
'test1',

View File

@ -159,7 +159,7 @@ const defaultParameters = (
params: PartialSome<IFeatureStrategy, 'id' | 'createdAt'>,
stickiness: string,
) => {
if (params.strategyName === 'gradualRollout') {
if (params.strategyName === 'flexibleRollout') {
return {
rollout: '100',
stickiness,

View File

@ -164,7 +164,7 @@ describe('strategy parameters default to sane defaults', () => {
createdByUserId: 9999,
});
const strategy = await featureStrategiesStore.createStrategyFeatureEnv({
strategyName: 'gradualRollout',
strategyName: 'flexibleRollout',
projectId: 'default',
environment: 'default',
featureName: toggle.name,
@ -184,7 +184,7 @@ describe('strategy parameters default to sane defaults', () => {
createdByUserId: 9999,
});
const strategy = await featureStrategiesStore.createStrategyFeatureEnv({
strategyName: 'gradualRollout',
strategyName: 'flexibleRollout',
projectId: 'default',
environment: 'default',
featureName: toggle.name,
@ -236,7 +236,7 @@ describe('strategy parameters default to sane defaults', () => {
createdByUserId: 9999,
});
const strategy = await featureStrategiesStore.createStrategyFeatureEnv({
strategyName: 'gradualRollout',
strategyName: 'flexibleRollout',
projectId: project.id,
environment: 'default',
featureName: toggle.name,