Fix
This commit is contained in:
parent
9ecb64a992
commit
7072244f31
|
@ -34,6 +34,7 @@ import {
|
||||||
roles,
|
roles,
|
||||||
withEnv as withCoreEnv,
|
withEnv as withCoreEnv,
|
||||||
setEnv as setCoreEnv,
|
setEnv as setCoreEnv,
|
||||||
|
env,
|
||||||
} from "@budibase/backend-core"
|
} from "@budibase/backend-core"
|
||||||
import sdk from "../../../sdk"
|
import sdk from "../../../sdk"
|
||||||
|
|
||||||
|
@ -696,6 +697,7 @@ describe.each([
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
isInternal &&
|
||||||
it("cannot update views v1", async () => {
|
it("cannot update views v1", async () => {
|
||||||
const viewV1 = await config.api.legacyView.save({
|
const viewV1 = await config.api.legacyView.save({
|
||||||
tableId: table._id!,
|
tableId: table._id!,
|
||||||
|
@ -2217,6 +2219,21 @@ describe.each([
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("foreign relationship columns", () => {
|
describe("foreign relationship columns", () => {
|
||||||
|
let envCleanup: () => void
|
||||||
|
beforeAll(() => {
|
||||||
|
const flags = [`*:${FeatureFlag.ENRICHED_RELATIONSHIPS}`]
|
||||||
|
if (env.TENANT_FEATURE_FLAGS) {
|
||||||
|
flags.push(...env.TENANT_FEATURE_FLAGS.split(","))
|
||||||
|
}
|
||||||
|
envCleanup = setCoreEnv({
|
||||||
|
TENANT_FEATURE_FLAGS: flags.join(","),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
afterAll(() => {
|
||||||
|
envCleanup?.()
|
||||||
|
})
|
||||||
|
|
||||||
const createMainTable = async (
|
const createMainTable = async (
|
||||||
links: {
|
links: {
|
||||||
name: string
|
name: string
|
||||||
|
@ -2263,14 +2280,14 @@ describe.each([
|
||||||
const auxTable = await createAuxTable({
|
const auxTable = await createAuxTable({
|
||||||
age: { name: "age", type: FieldType.NUMBER },
|
age: { name: "age", type: FieldType.NUMBER },
|
||||||
})
|
})
|
||||||
const table = await createMainTable([
|
|
||||||
{ name: "aux", tableId: auxTable._id!, fk: "fk_aux" },
|
|
||||||
])
|
|
||||||
|
|
||||||
const auxRow = await config.api.row.save(auxTable._id!, {
|
const auxRow = await config.api.row.save(auxTable._id!, {
|
||||||
name: generator.name(),
|
name: generator.name(),
|
||||||
age: generator.age(),
|
age: generator.age(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const table = await createMainTable([
|
||||||
|
{ name: "aux", tableId: auxTable._id!, fk: "fk_aux" },
|
||||||
|
])
|
||||||
await config.api.row.save(table._id!, {
|
await config.api.row.save(table._id!, {
|
||||||
title: generator.word(),
|
title: generator.word(),
|
||||||
aux: [auxRow],
|
aux: [auxRow],
|
||||||
|
@ -2291,20 +2308,7 @@ describe.each([
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const flags = [`*:${FeatureFlag.ENRICHED_RELATIONSHIPS}`]
|
const response = await config.api.viewV2.search(view.id)
|
||||||
if (isLucene) {
|
|
||||||
flags.push("*:!SQS")
|
|
||||||
} else if (isSqs) {
|
|
||||||
flags.push("*:SQS")
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await withCoreEnv(
|
|
||||||
{
|
|
||||||
TENANT_FEATURE_FLAGS: flags.join(","),
|
|
||||||
},
|
|
||||||
() => config.api.viewV2.search(view.id)
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(response.rows).toEqual([
|
expect(response.rows).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
aux: [
|
aux: [
|
||||||
|
@ -2356,10 +2360,7 @@ describe.each([
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const response = await withCoreEnv(
|
const response = await config.api.viewV2.search(view.id)
|
||||||
{ TENANT_FEATURE_FLAGS: `*:${FeatureFlag.ENRICHED_RELATIONSHIPS}` },
|
|
||||||
() => config.api.viewV2.search(view.id)
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(response.rows).toEqual([
|
expect(response.rows).toEqual([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
|
|
Loading…
Reference in New Issue