Renames
This commit is contained in:
parent
8a9474c2ac
commit
4c4c2e118b
|
@ -7,7 +7,7 @@ import { InternalTables } from "../../db/utils"
|
|||
import { TYPE_TRANSFORM_MAP } from "./map"
|
||||
import { FieldSubtype, Row, RowAttachment, Table } from "@budibase/types"
|
||||
import { cloneDeep } from "lodash/fp"
|
||||
import { processOutputBBReferences } from "./bbReferenceProcessor"
|
||||
import { processInputBBReferences } from "./bbReferenceProcessor"
|
||||
export * from "./utils"
|
||||
|
||||
type AutoColumnProcessingOpts = {
|
||||
|
@ -169,7 +169,7 @@ export async function inputProcessing(
|
|||
}
|
||||
|
||||
if (field.type === FieldTypes.BB_REFERENCE) {
|
||||
clonedRow[key] = await processOutputBBReferences(
|
||||
clonedRow[key] = await processInputBBReferences(
|
||||
value,
|
||||
field.subtype as FieldSubtype
|
||||
)
|
||||
|
|
|
@ -4,7 +4,7 @@ import { FieldType, FieldTypeSubtypes, Table } from "@budibase/types"
|
|||
import * as bbReferenceProcessor from "../bbReferenceProcessor"
|
||||
|
||||
jest.mock("../bbReferenceProcessor", (): typeof bbReferenceProcessor => ({
|
||||
processOutputBBReferences: jest.fn(),
|
||||
processInputBBReferences: jest.fn(),
|
||||
}))
|
||||
|
||||
describe("rowProcessor - inputProcessing", () => {
|
||||
|
@ -48,13 +48,13 @@ describe("rowProcessor - inputProcessing", () => {
|
|||
const user = structures.users.user()
|
||||
|
||||
;(
|
||||
bbReferenceProcessor.processOutputBBReferences as jest.Mock
|
||||
bbReferenceProcessor.processInputBBReferences as jest.Mock
|
||||
).mockResolvedValue(user)
|
||||
|
||||
const { row } = await inputProcessing(userId, table, newRow)
|
||||
|
||||
expect(bbReferenceProcessor.processOutputBBReferences).toBeCalledTimes(1)
|
||||
expect(bbReferenceProcessor.processOutputBBReferences).toBeCalledWith(
|
||||
expect(bbReferenceProcessor.processInputBBReferences).toBeCalledTimes(1)
|
||||
expect(bbReferenceProcessor.processInputBBReferences).toBeCalledWith(
|
||||
"123",
|
||||
"user"
|
||||
)
|
||||
|
@ -96,7 +96,7 @@ describe("rowProcessor - inputProcessing", () => {
|
|||
|
||||
const { row } = await inputProcessing(userId, table, newRow)
|
||||
|
||||
expect(bbReferenceProcessor.processOutputBBReferences).not.toBeCalled()
|
||||
expect(bbReferenceProcessor.processInputBBReferences).not.toBeCalled()
|
||||
expect(row).toEqual({ ...newRow, user: undefined })
|
||||
})
|
||||
|
||||
|
@ -134,7 +134,7 @@ describe("rowProcessor - inputProcessing", () => {
|
|||
|
||||
const { row } = await inputProcessing(userId, table, newRow)
|
||||
|
||||
expect(bbReferenceProcessor.processOutputBBReferences).not.toBeCalled()
|
||||
expect(bbReferenceProcessor.processInputBBReferences).not.toBeCalled()
|
||||
expect(row).toEqual({
|
||||
name: "Jack",
|
||||
user: 123,
|
||||
|
|
Loading…
Reference in New Issue