1
0
Fork 0
mirror of synced 2024-09-20 19:33:10 +12:00

Test case.

This commit is contained in:
mike12345567 2024-07-22 15:17:42 +01:00
parent 4f05f33b08
commit 3247e13a32

View file

@ -6,9 +6,11 @@ import {
} from "../../../integrations/tests/utils"
import {
db as dbCore,
context,
MAX_VALID_DATE,
MIN_VALID_DATE,
utils,
SQLITE_DESIGN_DOC_ID,
} from "@budibase/backend-core"
import * as setup from "./utilities"
@ -2524,4 +2526,38 @@ describe.each([
}).toContainExactly([{ [" name"]: "foo" }])
})
})
isSqs &&
describe("duplicate columns", () => {
beforeAll(async () => {
table = await createTable({
name: {
name: "name",
type: FieldType.STRING,
},
})
await context.doInAppContext(config.appId!, async () => {
const db = context.getAppDB()
const tableDoc = await db.get<Table>(table._id!)
tableDoc.schema.Name = {
name: "Name",
type: FieldType.STRING,
}
try {
// remove the SQLite definitions so that they can be rebuilt as part of the search
const sqliteDoc = await db.get(SQLITE_DESIGN_DOC_ID)
await db.remove(sqliteDoc)
} catch (err) {
// no-op
}
})
await createRows([{ name: "foo", Name: "bar" }])
})
it("should handle invalid duplicate column names", async () => {
await expectSearch({
query: {},
}).toContainExactly([{ name: "foo" }])
})
})
})