mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
fix: correct failing feature toggle test
This commit is contained in:
parent
90962434d9
commit
1b1bb97715
@ -504,8 +504,9 @@ test('Should archive feature toggle', async () => {
|
|||||||
expect(toggle).toBeDefined();
|
expect(toggle).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can add strategy to feature toggle', async () => {
|
test('Can add strategy to feature toggle to default env', async () => {
|
||||||
const envName = 'add-strategy';
|
const envName = 'default';
|
||||||
|
const featureName = 'feature.strategy.toggle';
|
||||||
// Create environment
|
// Create environment
|
||||||
await app.request
|
await app.request
|
||||||
.post('/api/admin/environments')
|
.post('/api/admin/environments')
|
||||||
@ -522,7 +523,7 @@ test('Can add strategy to feature toggle', async () => {
|
|||||||
environment: envName,
|
environment: envName,
|
||||||
})
|
})
|
||||||
.expect(200);
|
.expect(200);
|
||||||
const featureName = 'feature.strategy.toggle';
|
|
||||||
await app.request
|
await app.request
|
||||||
.post('/api/admin/projects/default/features')
|
.post('/api/admin/projects/default/features')
|
||||||
.send({ name: featureName })
|
.send({ name: featureName })
|
||||||
@ -541,7 +542,8 @@ test('Can add strategy to feature toggle', async () => {
|
|||||||
await app.request
|
await app.request
|
||||||
.get(`/api/admin/projects/default/features/${featureName}`)
|
.get(`/api/admin/projects/default/features/${featureName}`)
|
||||||
.expect((res) => {
|
.expect((res) => {
|
||||||
expect(res.body.environments[0].strategies).toHaveLength(1);
|
const env = res.body.environments.find((e) => e.name === envName);
|
||||||
|
expect(env.strategies).toHaveLength(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user