Fixing test case.

This commit is contained in:
mike12345567 2024-11-26 15:54:59 +00:00
parent a190feb4ea
commit a27c28ccdf
2 changed files with 7 additions and 6 deletions

View File

@ -15,7 +15,7 @@ import {
} from "@budibase/types" } from "@budibase/types"
import * as linkRows from "../../../db/linkedRows" import * as linkRows from "../../../db/linkedRows"
import isEqual from "lodash/isEqual" import isEqual from "lodash/isEqual"
import { cloneDeep } from "lodash/fp" import { cloneDeep, merge } from "lodash/fp"
import sdk from "../../../sdk" import sdk from "../../../sdk"
import * as pro from "@budibase/pro" import * as pro from "@budibase/pro"
@ -164,10 +164,7 @@ export async function finaliseRow(
await db.put(row) await db.put(row)
const retrieved = await db.tryGet<Row>(row._id) const retrieved = await db.tryGet<Row>(row._id)
enrichedRow = { enrichedRow = merge(retrieved, enrichedRow)
...enrichedRow,
...retrieved,
}
enrichedRow = await processFormulas(table, enrichedRow, { enrichedRow = await processFormulas(table, enrichedRow, {
dynamic: false, dynamic: false,
}) })

View File

@ -85,7 +85,7 @@ function encodeJS(binding: string) {
return `{{ js "${Buffer.from(binding).toString("base64")}"}}` return `{{ js "${Buffer.from(binding).toString("base64")}"}}`
} }
const descriptions = datasourceDescribe({ exclude: [DatabaseName.MONGODB] }) const descriptions = datasourceDescribe({ only: [DatabaseName.SQS] })
if (descriptions.length) { if (descriptions.length) {
describe.each(descriptions)( describe.each(descriptions)(
@ -2571,12 +2571,14 @@ if (descriptions.length) {
let tableId: string let tableId: string
let o2mData: Row[] let o2mData: Row[]
let m2mData: Row[] let m2mData: Row[]
let isRelationship: boolean
beforeAll(async () => { beforeAll(async () => {
const table = await config.api.table.save( const table = await config.api.table.save(
defaultTable({ schema: relSchema() }) defaultTable({ schema: relSchema() })
) )
tableId = table._id! tableId = table._id!
isRelationship = relSchema().user.type === FieldType.LINK
o2mData = [ o2mData = [
await dataGenerator(o2mTable._id!), await dataGenerator(o2mTable._id!),
@ -2763,6 +2765,8 @@ if (descriptions.length) {
type: isInternal ? "row" : undefined, type: isInternal ? "row" : undefined,
createdAt: isInternal ? new Date().toISOString() : undefined, createdAt: isInternal ? new Date().toISOString() : undefined,
updatedAt: isInternal ? new Date().toISOString() : undefined, updatedAt: isInternal ? new Date().toISOString() : undefined,
users: isRelationship ? undefined : [],
user: isRelationship ? undefined : [],
}) })
}) })