From 74ac68d72d81d4c045b44663e0314112dca497af Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 14 May 2024 18:22:55 +0200 Subject: [PATCH] Fix tests --- packages/server/src/utilities/rowProcessor/index.ts | 7 ++++--- .../utilities/rowProcessor/tests/inputProcessing.spec.ts | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/server/src/utilities/rowProcessor/index.ts b/packages/server/src/utilities/rowProcessor/index.ts index a3f3ebc8f6..59237be5f3 100644 --- a/packages/server/src/utilities/rowProcessor/index.ts +++ b/packages/server/src/utilities/rowProcessor/index.ts @@ -164,11 +164,12 @@ export async function inputProcessing( delete clonedRow[key].url } } else if ( - field.type === FieldType.BB_REFERENCE_SINGLE || - helpers.schema.isDeprecatedSingleUserColumn(field) + value && + (field.type === FieldType.BB_REFERENCE_SINGLE || + helpers.schema.isDeprecatedSingleUserColumn(field)) ) { clonedRow[key] = await processInputBBReference(value, field.subtype) - } else if (field.type === FieldType.BB_REFERENCE) { + } else if (value && field.type === FieldType.BB_REFERENCE) { clonedRow[key] = await processInputBBReferences(value, field.subtype) } } diff --git a/packages/server/src/utilities/rowProcessor/tests/inputProcessing.spec.ts b/packages/server/src/utilities/rowProcessor/tests/inputProcessing.spec.ts index b1928b696b..81094583e2 100644 --- a/packages/server/src/utilities/rowProcessor/tests/inputProcessing.spec.ts +++ b/packages/server/src/utilities/rowProcessor/tests/inputProcessing.spec.ts @@ -102,7 +102,7 @@ describe("rowProcessor - inputProcessing", () => { name: "user", constraints: { presence: true, - type: "string", + type: "array", }, }, }, @@ -154,7 +154,7 @@ describe("rowProcessor - inputProcessing", () => { name: "user", constraints: { presence: false, - type: "string", + type: "array", }, }, }, @@ -196,7 +196,7 @@ describe("rowProcessor - inputProcessing", () => { name: "user", constraints: { presence: false, - type: "string", + type: "array", }, }, },