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:
parent
1486cdab52
commit
786260434d
@ -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 },
|
||||
);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user