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

fix: Add a test for validation of empty params

This commit is contained in:
Christopher Kolstad 2021-02-05 14:07:46 +01:00 committed by Ivar Conradi Østhus
parent 1486cdab52
commit 786260434d

View File

@ -362,3 +362,22 @@ test('should reject updating addon config with missing required parameter', asyn
{ instanceOf: ValidationError },
);
});
test('Should reject addon config if a required parameter is just the empty string', async t => {
const { addonService } = getSetup();
const config = {
provider: 'simple',
enabled: true,
parameters: {
url: '',
var: 'some-value',
},
events: [FEATURE_CREATED],
};
await t.throwsAsync(
async () => addonService.createAddon(config, 'me@mail.com'),
{ instanceOf: ValidationError },
);
});