1
0
Fork 0
mirror of synced 2024-09-19 18:59:06 +12:00

Add extra tests

This commit is contained in:
Adria Navarro 2024-08-28 13:16:42 +02:00
parent 458ef9e754
commit 9b67481661

View file

@ -1084,9 +1084,36 @@ describe.each([
expect(row.one).toBeUndefined()
expect(row.two).toEqual("bar")
})
it("should not return non-view view fields for a row", async () => {
const newRow = await config.api.row.save(view.id, {
one: "foo",
two: "bar",
})
expect(newRow.one).toBeUndefined()
expect(newRow.two).toEqual("bar")
})
})
describe("patch", () => {
it("should not return non-view view fields for a row", async () => {
const newRow = await config.api.row.save(table._id!, {
one: "foo",
two: "bar",
})
const row = await config.api.row.patch(view.id, {
tableId: table._id!,
_id: newRow._id!,
_rev: newRow._rev!,
one: "newFoo",
two: "newBar",
})
expect(row.one).toBeUndefined()
expect(row.two).toEqual("newBar")
})
it("should update only the view fields for a row", async () => {
const newRow = await config.api.row.save(table._id!, {
one: "foo",