1
0
Fork 0
mirror of synced 2024-08-12 00:22:02 +12:00

Test case for returning missing columns as visible: false

This commit is contained in:
mike12345567 2023-08-11 15:16:33 +01:00
parent 71d8ea5743
commit 199d27fc89

View file

@ -444,4 +444,25 @@ describe("/v2/views", () => {
expect(await getPersistedView()).toBeUndefined()
})
})
describe("fetch view (through table)", () => {
it("should be able to fetch a view V2", async () => {
const table = await config.createTable(priceTable())
const newView: CreateViewRequest = {
name: generator.name(),
tableId: table._id!,
schema: {
Price: { visible: false },
Category: { visible: true },
},
}
const res = await config.api.viewV2.create(newView)
const view = await config.api.viewV2.get(res.id)
expect(view!.schemaUI?.Price).toBeUndefined()
const updatedTable = await config.getTable(table._id!)
const viewSchema = updatedTable.views[view!.name!].schema
expect(viewSchema.Price.visible).toEqual(false)
})
})
})