Add test for creating a row through views.

This commit is contained in:
Sam Rose 2024-07-15 16:44:43 +01:00
parent 18acaccfcb
commit e39a5b0d7e
No known key found for this signature in database
2 changed files with 10 additions and 1 deletions

View File

@ -551,7 +551,9 @@ describe.each([
expect(row.name).toEqual(`{ "foo": "2023-01-26T11:48:57.000Z" }`)
})
describe.only("default values", () => {
describe("default values", () => {
let table: Table
describe("string column", () => {
beforeAll(async () => {
table = await config.api.table.save(

View File

@ -1022,6 +1022,11 @@ describe.each([
schema: {
one: { type: FieldType.STRING, name: "one" },
two: { type: FieldType.STRING, name: "two" },
default: {
type: FieldType.STRING,
name: "default",
default: "default",
},
},
})
)
@ -1042,11 +1047,13 @@ describe.each([
_viewId: view.id,
one: "foo",
two: "bar",
default: "ohnoes",
})
const row = await config.api.row.get(table._id!, newRow._id!)
expect(row.one).toBeUndefined()
expect(row.two).toEqual("bar")
expect(row.default).toEqual("default")
})
it("can't persist readonly columns", async () => {