mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
fix: failing tests for 409
This commit is contained in:
parent
31b1457067
commit
0204a52d9b
@ -72,7 +72,7 @@ test('should not be allowed reuse context field name', t => {
|
||||
.post(`${base}/api/admin/context/validate`)
|
||||
.send({ name: 'environment' })
|
||||
.set('Content-Type', 'application/json')
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
|
||||
test('should create a context field', t => {
|
||||
@ -120,7 +120,7 @@ test('should not create a context field with existing name', t => {
|
||||
.post(`${base}/api/admin/context`)
|
||||
.send({ name: 'userId', description: 'Bla bla' })
|
||||
.set('Content-Type', 'application/json')
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
|
||||
test('should not create a context field with duplicate legal values', t => {
|
||||
|
@ -131,7 +131,7 @@ test('should not be allowed to reuse active toggle name', t => {
|
||||
.post(`${base}/api/admin/features/validate`)
|
||||
.send({ name: 'ts' })
|
||||
.set('Content-Type', 'application/json')
|
||||
.expect(400)
|
||||
.expect(409)
|
||||
.expect(res => {
|
||||
t.true(
|
||||
res.body.details[0].message ===
|
||||
@ -152,7 +152,7 @@ test('should not be allowed to reuse archived toggle name', t => {
|
||||
.post(`${base}/api/admin/features/validate`)
|
||||
.send({ name: 'ts.archived' })
|
||||
.set('Content-Type', 'application/json')
|
||||
.expect(400)
|
||||
.expect(409)
|
||||
.expect(res => {
|
||||
t.true(
|
||||
res.body.details[0].message ===
|
||||
|
@ -100,7 +100,7 @@ test('not be possible to override name', t => {
|
||||
return request
|
||||
.post(`${base}/api/admin/strategies`)
|
||||
.send({ name: 'Testing', parameters: [] })
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
|
||||
test('update strategy', t => {
|
||||
|
@ -103,7 +103,7 @@ test.serial(
|
||||
.post('/api/admin/context')
|
||||
.send({ name: 'userId' })
|
||||
.set('Content-Type', 'application/json')
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
},
|
||||
);
|
||||
|
||||
@ -140,7 +140,7 @@ test.serial('should validate name to not ok', async t => {
|
||||
.post('/api/admin/context/validate')
|
||||
.send({ name: 'environment' })
|
||||
.set('Content-Type', 'application/json')
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
|
||||
test.serial('should validate name to not ok for non url-friendly', async t => {
|
||||
|
@ -174,7 +174,7 @@ test.serial('refuses to create a feature with an existing name', async t => {
|
||||
.post('/api/admin/features')
|
||||
.send({ name: 'featureX' })
|
||||
.set('Content-Type', 'application/json')
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
|
||||
test.serial('refuses to validate a feature with an existing name', async t => {
|
||||
@ -184,7 +184,7 @@ test.serial('refuses to validate a feature with an existing name', async t => {
|
||||
.post('/api/admin/features/validate')
|
||||
.send({ name: 'featureX' })
|
||||
.set('Content-Type', 'application/json')
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
|
||||
test.serial(
|
||||
@ -221,7 +221,7 @@ test.serial('should not be possible to create archived toggle', async t => {
|
||||
strategies: [{ name: 'default' }],
|
||||
})
|
||||
.set('Content-Type', 'application/json')
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
|
||||
test.serial('creates new feature toggle with variant overrides', async t => {
|
||||
|
@ -81,7 +81,7 @@ test.serial('refuses to create a strategy with an existing name', async t => {
|
||||
.post('/api/admin/strategies')
|
||||
.send({ name: 'default', parameters: [] })
|
||||
.set('Content-Type', 'application/json')
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
|
||||
test.serial('deletes a new strategy', async t => {
|
||||
|
Loading…
Reference in New Issue
Block a user