catalog-backend: relations working e2e

Co-authored-by: blam <ben@blam.sh>
This commit is contained in:
Patrik Oldsberg
2020-10-20 17:57:11 +02:00
parent 62493e54c1
commit e26201d9d2
11 changed files with 176 additions and 107 deletions
@@ -32,21 +32,21 @@ const schema = yup.object<Partial<GroupEntityV1alpha1>>({
// one element and there is no simple workaround -_-
// the cast is there to convince typescript that the array itself is
// required without using .required()
ancestors: yup.array(yup.string().required()).test({
name: 'isDefined',
message: 'ancestors must be defined',
test: v => Boolean(v),
}) as yup.ArraySchema<string, object>,
children: yup.array(yup.string().required()).test({
name: 'isDefined',
message: 'children must be defined',
test: v => Boolean(v),
}) as yup.ArraySchema<string, object>,
descendants: yup.array(yup.string().required()).test({
name: 'isDefined',
message: 'descendants must be defined',
test: v => Boolean(v),
}) as yup.ArraySchema<string, object>,
// ancestors: yup.array(yup.string().required()).test({
// name: 'isDefined',
// message: 'ancestors must be defined',
// test: v => Boolean(v),
// }) as yup.ArraySchema<string, object>,
// children: yup.array(yup.string().required()).test({
// name: 'isDefined',
// message: 'children must be defined',
// test: v => Boolean(v),
// }) as yup.ArraySchema<string, object>,
// descendants: yup.array(yup.string().required()).test({
// name: 'isDefined',
// message: 'descendants must be defined',
// test: v => Boolean(v),
// }) as yup.ArraySchema<string, object>,
})
.required(),
});
@@ -37,11 +37,11 @@ const schema = yup.object<Partial<UserEntityV1alpha1>>({
// element and there is no simple workaround -_-
// the cast is there to convince typescript that the array itself is
// required without using .required()
memberOf: yup.array(yup.string().required()).test({
name: 'isDefined',
message: 'memberOf must be defined',
test: v => Boolean(v),
}) as yup.ArraySchema<string, object>,
// memberOf: yup.array(yup.string().required()).test({
// name: 'isDefined',
// message: 'memberOf must be defined',
// test: v => Boolean(v),
// }) as yup.ArraySchema<string, object>,
})
.required(),
});