mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-16 00:06:40 +01:00
fix: make default for gradual rollout work on the correct strategy name (#7401)
This commit is contained in:
parent
c33901b332
commit
4eaa1525a0
@ -25,7 +25,11 @@ const apiClientResponse = [
|
|||||||
{
|
{
|
||||||
name: 'flexibleRollout',
|
name: 'flexibleRollout',
|
||||||
constraints: [],
|
constraints: [],
|
||||||
parameters: { rollout: '100' },
|
parameters: {
|
||||||
|
rollout: '100',
|
||||||
|
stickiness: 'default',
|
||||||
|
groupId: 'test1',
|
||||||
|
},
|
||||||
variants: [],
|
variants: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -169,7 +173,11 @@ test('should return correct data structure from /api/client/features', async ()
|
|||||||
{
|
{
|
||||||
name: 'flexibleRollout',
|
name: 'flexibleRollout',
|
||||||
constraints: [],
|
constraints: [],
|
||||||
parameters: { rollout: '100' },
|
parameters: {
|
||||||
|
rollout: '100',
|
||||||
|
stickiness: 'default',
|
||||||
|
groupId: 'test1',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
DEFAULT_ENV,
|
DEFAULT_ENV,
|
||||||
'test1',
|
'test1',
|
||||||
|
@ -159,7 +159,7 @@ const defaultParameters = (
|
|||||||
params: PartialSome<IFeatureStrategy, 'id' | 'createdAt'>,
|
params: PartialSome<IFeatureStrategy, 'id' | 'createdAt'>,
|
||||||
stickiness: string,
|
stickiness: string,
|
||||||
) => {
|
) => {
|
||||||
if (params.strategyName === 'gradualRollout') {
|
if (params.strategyName === 'flexibleRollout') {
|
||||||
return {
|
return {
|
||||||
rollout: '100',
|
rollout: '100',
|
||||||
stickiness,
|
stickiness,
|
||||||
|
@ -164,7 +164,7 @@ describe('strategy parameters default to sane defaults', () => {
|
|||||||
createdByUserId: 9999,
|
createdByUserId: 9999,
|
||||||
});
|
});
|
||||||
const strategy = await featureStrategiesStore.createStrategyFeatureEnv({
|
const strategy = await featureStrategiesStore.createStrategyFeatureEnv({
|
||||||
strategyName: 'gradualRollout',
|
strategyName: 'flexibleRollout',
|
||||||
projectId: 'default',
|
projectId: 'default',
|
||||||
environment: 'default',
|
environment: 'default',
|
||||||
featureName: toggle.name,
|
featureName: toggle.name,
|
||||||
@ -184,7 +184,7 @@ describe('strategy parameters default to sane defaults', () => {
|
|||||||
createdByUserId: 9999,
|
createdByUserId: 9999,
|
||||||
});
|
});
|
||||||
const strategy = await featureStrategiesStore.createStrategyFeatureEnv({
|
const strategy = await featureStrategiesStore.createStrategyFeatureEnv({
|
||||||
strategyName: 'gradualRollout',
|
strategyName: 'flexibleRollout',
|
||||||
projectId: 'default',
|
projectId: 'default',
|
||||||
environment: 'default',
|
environment: 'default',
|
||||||
featureName: toggle.name,
|
featureName: toggle.name,
|
||||||
@ -236,7 +236,7 @@ describe('strategy parameters default to sane defaults', () => {
|
|||||||
createdByUserId: 9999,
|
createdByUserId: 9999,
|
||||||
});
|
});
|
||||||
const strategy = await featureStrategiesStore.createStrategyFeatureEnv({
|
const strategy = await featureStrategiesStore.createStrategyFeatureEnv({
|
||||||
strategyName: 'gradualRollout',
|
strategyName: 'flexibleRollout',
|
||||||
projectId: project.id,
|
projectId: project.id,
|
||||||
environment: 'default',
|
environment: 'default',
|
||||||
featureName: toggle.name,
|
featureName: toggle.name,
|
||||||
|
Loading…
Reference in New Issue
Block a user