Add describe

This commit is contained in:
Adria Navarro 2024-12-18 15:54:07 +01:00
parent 96bddbb545
commit e23753ac61
1 changed files with 227 additions and 213 deletions

View File

@ -34,9 +34,14 @@ describe("buildSqlFieldList", () => {
}, },
} }
describe("table", () => {
it("extracts fields from table schema", async () => { it("extracts fields from table schema", async () => {
const result = await buildSqlFieldList(basicTable, {}) const result = await buildSqlFieldList(basicTable, {})
expect(result).toEqual(["table.name", "table.description", "table.amount"]) expect(result).toEqual([
"table.name",
"table.description",
"table.amount",
])
}) })
it("excludes hidden fields", async () => { it("excludes hidden fields", async () => {
@ -67,7 +72,11 @@ describe("buildSqlFieldList", () => {
} }
const result = await buildSqlFieldList(table, {}) const result = await buildSqlFieldList(table, {})
expect(result).toEqual(["table.name", "table.description", "table.amount"]) expect(result).toEqual([
"table.name",
"table.description",
"table.amount",
])
}) })
it("includes hidden fields if there is a formula column", async () => { it("includes hidden fields if there is a formula column", async () => {
@ -80,7 +89,11 @@ describe("buildSqlFieldList", () => {
} }
const result = await buildSqlFieldList(table, {}) const result = await buildSqlFieldList(table, {})
expect(result).toEqual(["table.name", "table.description", "table.amount"]) expect(result).toEqual([
"table.name",
"table.description",
"table.amount",
])
}) })
it("includes relationships fields when flag", async () => { it("includes relationships fields when flag", async () => {
@ -255,3 +268,4 @@ describe("buildSqlFieldList", () => {
]) ])
}) })
}) })
})