Remove unnecessary row mappings. Updated input processing tests to accommodate clearing BB_REFERENCE types by defaulting to an empty array
This commit is contained in:
parent
fdbf1b3469
commit
7d274e5a84
|
@ -57,13 +57,6 @@ export const TYPE_TRANSFORM_MAP: any = {
|
|||
[undefined]: undefined,
|
||||
parse: parseArrayString,
|
||||
},
|
||||
[FieldType.BB_REFERENCE_SINGLE]: {
|
||||
"": null,
|
||||
//@ts-ignore
|
||||
[null]: null,
|
||||
//@ts-ignore
|
||||
[undefined]: undefined,
|
||||
},
|
||||
[FieldType.STRING]: {
|
||||
"": null,
|
||||
//@ts-ignore
|
||||
|
@ -127,9 +120,6 @@ export const TYPE_TRANSFORM_MAP: any = {
|
|||
[undefined]: undefined,
|
||||
parse: parseArrayString,
|
||||
},
|
||||
[FieldType.ATTACHMENT_SINGLE]: {
|
||||
"": null,
|
||||
},
|
||||
[FieldType.BOOLEAN]: {
|
||||
"": null,
|
||||
//@ts-ignore
|
||||
|
|
|
@ -209,10 +209,22 @@ describe("rowProcessor - inputProcessing", () => {
|
|||
|
||||
const { row } = await inputProcessing(userId, table, newRow)
|
||||
|
||||
if (userValue === undefined) {
|
||||
// The 'user' field is omitted
|
||||
expect(row).toEqual({
|
||||
name: "Jack",
|
||||
})
|
||||
} else {
|
||||
// The update is processed if null or "". 'user' is changed to an empty array.
|
||||
expect(row).toEqual({
|
||||
name: "Jack",
|
||||
user: [],
|
||||
})
|
||||
}
|
||||
|
||||
expect(
|
||||
bbReferenceProcessor.processInputBBReferences
|
||||
).not.toHaveBeenCalled()
|
||||
expect(row).toEqual(newRow)
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue