diff --git a/routes/api/consultation/update(id).patch.spec.ts b/routes/api/consultation/update(id).patch.spec.ts index c3d3de21f..d38899e60 100644 --- a/routes/api/consultation/update(id).patch.spec.ts +++ b/routes/api/consultation/update(id).patch.spec.ts @@ -63,7 +63,9 @@ describe("Controller: PATCH /api/consultation/:id", () => { await requester.runMiddleware(bodyValidationFunction) const body = requester.expectFailure(ErrorBag).toJSON() - expect(body).toHaveLength(1) + // There are two errors due to `or` validator + expect(body).toHaveLength(2) expect(body).toHaveProperty("0.source.pointer", "data.attributes.finishedAt") + expect(body).toHaveProperty("1.source.pointer", "data.attributes.finishedAt") }) }) diff --git a/server/validators/logical/or.ts b/server/validators/logical/or.ts index 9ee8f220f..5fa6c9387 100644 --- a/server/validators/logical/or.ts +++ b/server/validators/logical/or.ts @@ -41,7 +41,6 @@ export default async function( constraints.source ) - console.log("verified", value, subrules) return { "maySkip": true, "value": value[constraints.field]