Add failing test

This commit is contained in:
Adria Navarro 2024-12-18 10:40:12 +01:00
parent 15f2aaf950
commit b538125d1f
1 changed files with 31 additions and 1 deletions

View File

@ -55,7 +55,7 @@ if (descriptions.length) {
let datasource: Datasource | undefined
function saveTableRequest(
...overrides: Partial<Omit<SaveTableRequest, "name">>[]
...overrides: Partial<SaveTableRequest>[]
): SaveTableRequest {
const req: SaveTableRequest = {
name: generator.guid().replaceAll("-", "").substring(0, 16),
@ -1898,6 +1898,36 @@ if (descriptions.length) {
}
expect(view.queryUI).toEqual(expected)
})
it("tables and views can contain whitespaces", async () => {
const table = await config.api.table.save(
saveTableRequest({
name: "table with spaces",
schema: {
name: {
type: FieldType.STRING,
name: "name",
},
},
})
)
const view = await config.api.viewV2.create({
tableId: table._id!,
name: `view name with spaces`,
schema: {
name: { visible: true },
},
})
expect(await getDelegate(view)).toEqual({
...view,
schema: {
id: { ...table.schema["id"], visible: false },
name: { ...table.schema["name"], visible: true },
},
})
})
})
describe("updating table schema", () => {