mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
test: describe default stickiness bahavior in a test (#7379)
This commit is contained in:
parent
b5de65bb8e
commit
702ee8cb12
@ -734,3 +734,32 @@ test('Should return last seen at per environment', async () => {
|
||||
);
|
||||
expect(featureToggle.lastSeenAt).toEqual(new Date(lastSeenAtStoreDate));
|
||||
});
|
||||
|
||||
test('Should return "default" for stickiness when creating a flexibleRollout strategy with empty stickiness', async () => {
|
||||
const strategy = {
|
||||
name: 'flexibleRollout',
|
||||
parameters: {
|
||||
rollout: '100',
|
||||
stickiness: '',
|
||||
},
|
||||
constraints: [],
|
||||
};
|
||||
const feature = {
|
||||
name: 'test-feature-stickiness-1',
|
||||
description: 'the #1 feature',
|
||||
};
|
||||
const projectId = 'default';
|
||||
|
||||
await service.createFeatureToggle(projectId, feature, TEST_AUDIT_USER);
|
||||
await service.createStrategy(
|
||||
strategy,
|
||||
{ projectId, featureName: feature.name, environment: DEFAULT_ENV },
|
||||
TEST_AUDIT_USER,
|
||||
);
|
||||
|
||||
const featureDB = await service.getFeature({ featureName: feature.name });
|
||||
|
||||
expect(featureDB.environments[0]).toMatchObject({
|
||||
strategies: [{ parameters: { stickiness: 'default' } }],
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user