mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
parent
9052a5a5df
commit
3c860d7bce
@ -8,12 +8,16 @@ const nameSchema = joi.object().keys({ name: nameType });
|
||||
const constraintSchema = joi.object().keys({
|
||||
contextName: joi.string(),
|
||||
operator: joi.string(),
|
||||
values: joi.array().items(
|
||||
joi
|
||||
.string()
|
||||
.min(1)
|
||||
.max(100),
|
||||
),
|
||||
values: joi
|
||||
.array()
|
||||
.items(
|
||||
joi
|
||||
.string()
|
||||
.min(1)
|
||||
.max(100),
|
||||
)
|
||||
.min(1)
|
||||
.optional(),
|
||||
});
|
||||
|
||||
const strategiesSchema = joi.object().keys({
|
||||
|
@ -220,7 +220,9 @@ test('should not accept empty list of constraint values', t => {
|
||||
],
|
||||
};
|
||||
|
||||
const { value, error } = featureShema.validate(toggle);
|
||||
t.deepEqual(value, toggle);
|
||||
t.falsy(error);
|
||||
const { error } = featureShema.validate(toggle);
|
||||
t.deepEqual(
|
||||
error.details[0].message,
|
||||
'"strategies[0].constraints[0].values" must contain at least 1 items',
|
||||
);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user