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