1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: Application fields should be optional.

This commit is contained in:
ivaosthu 2019-05-10 13:47:56 +02:00 committed by Ivar Conradi Østhus
parent 9ee7a715c2
commit 9c32a28597
3 changed files with 30 additions and 5 deletions

View File

@ -2,6 +2,7 @@
## 3.2.10 ## 3.2.10
- fix: Strategies should not be required for updateding application details
- feat: boolean strategy paramters - feat: boolean strategy paramters
## 3.2.9 ## 3.2.9

View File

@ -11,12 +11,24 @@ const applicationSchema = joi
sdkVersion: joi.string().optional(), sdkVersion: joi.string().optional(),
strategies: joi strategies: joi
.array() .array()
.required() .optional()
.items(joi.string(), joi.any().strip()), .items(joi.string(), joi.any().strip()),
description: joi.string().optional(), description: joi
url: joi.string().optional(), .string()
color: joi.string().optional(), .allow('')
icon: joi.string().optional(), .optional(),
url: joi
.string()
.allow('')
.optional(),
color: joi
.string()
.allow('')
.optional(),
icon: joi
.string()
.allow('')
.optional(),
}); });
module.exports = applicationSchema; module.exports = applicationSchema;

View File

@ -142,3 +142,15 @@ test('should store application', t => {
.send({ appName, strategies: ['default'] }) .send({ appName, strategies: ['default'] })
.expect(202); .expect(202);
}); });
test('should store application details wihtout strategies', t => {
t.plan(0);
const { request, perms } = getSetup();
const appName = '123!23';
perms.withPermissions(UPDATE_APPLICATION);
return request
.post(`/api/admin/metrics/applications/${appName}`)
.send({ appName, url: 'htto://asd.com' })
.expect(202);
});