Adding parameterised tests.

This commit is contained in:
mike12345567 2024-06-28 15:21:39 +01:00
parent 13ac273c83
commit b3d07aa228
1 changed files with 23 additions and 20 deletions

View File

@ -2109,25 +2109,28 @@ describe.each([
}) })
}) })
describe("special data_ case", () => { describe.each(["data_name_test", "name_data_test", "name_test_data_"])(
beforeAll(async () => { "special (%s) case",
table = await createTable({ column => {
name_data_test: { beforeAll(async () => {
name: "name_data_test", table = await createTable({
type: FieldType.STRING, [column]: {
}, name: column,
}) type: FieldType.STRING,
await createRows([{ name_data_test: "a" }, { name_data_test: "b" }])
})
it("should be able to query a column with data_ in it", async () => {
await expectSearch({
query: {
equal: {
["1:name_data_test"]: "a",
}, },
}, })
}).toContainExactly([{ name_data_test: "a" }]) await createRows([{ [column]: "a" }, { [column]: "b" }])
}) })
})
it("should be able to query a column with data_ in it", async () => {
await expectSearch({
query: {
equal: {
[`1:${column}`]: "a",
},
},
}).toContainExactly([{ [column]: "a" }])
})
}
)
}) })