Test case.
This commit is contained in:
parent
4f05f33b08
commit
3247e13a32
|
@ -6,9 +6,11 @@ import {
|
||||||
} from "../../../integrations/tests/utils"
|
} from "../../../integrations/tests/utils"
|
||||||
import {
|
import {
|
||||||
db as dbCore,
|
db as dbCore,
|
||||||
|
context,
|
||||||
MAX_VALID_DATE,
|
MAX_VALID_DATE,
|
||||||
MIN_VALID_DATE,
|
MIN_VALID_DATE,
|
||||||
utils,
|
utils,
|
||||||
|
SQLITE_DESIGN_DOC_ID,
|
||||||
} from "@budibase/backend-core"
|
} from "@budibase/backend-core"
|
||||||
|
|
||||||
import * as setup from "./utilities"
|
import * as setup from "./utilities"
|
||||||
|
@ -2524,4 +2526,38 @@ describe.each([
|
||||||
}).toContainExactly([{ [" name"]: "foo" }])
|
}).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" }])
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue