Fix tests
This commit is contained in:
parent
7050c5352a
commit
1a00b60088
|
@ -48,7 +48,7 @@ export async function processOutputBBReferences(
|
|||
) {
|
||||
if (typeof value !== "string") {
|
||||
// Already processed or nothing to process
|
||||
return value
|
||||
return value || undefined
|
||||
}
|
||||
|
||||
const ids = value.split(",").filter(id => !!id)
|
||||
|
|
|
@ -235,9 +235,6 @@ export async function outputProcessing<T extends Row[] | Row>(
|
|||
}
|
||||
} else if (column.type == FieldTypes.BB_REFERENCE) {
|
||||
for (let row of enriched) {
|
||||
if (row[property] == null) {
|
||||
continue
|
||||
}
|
||||
row[property] = await processOutputBBReferences(
|
||||
row[property],
|
||||
column.subtype as FieldSubtype
|
||||
|
|
|
@ -66,7 +66,7 @@ describe("rowProcessor - outputProcessing", () => {
|
|||
)
|
||||
})
|
||||
|
||||
it("does not fetch bb references when fields are empty", async () => {
|
||||
it("process output even when the field is not empty", async () => {
|
||||
const table: Table = {
|
||||
_id: generator.guid(),
|
||||
name: "TestTable",
|
||||
|
@ -100,7 +100,7 @@ describe("rowProcessor - outputProcessing", () => {
|
|||
|
||||
expect(result).toEqual({ name: "Jack" })
|
||||
|
||||
expect(bbReferenceProcessor.processOutputBBReferences).not.toBeCalled()
|
||||
expect(bbReferenceProcessor.processOutputBBReferences).toBeCalledTimes(1)
|
||||
})
|
||||
|
||||
it("does not fetch bb references when not in the schema", async () => {
|
||||
|
|
Loading…
Reference in New Issue