Remove view tests
This commit is contained in:
parent
11f0569446
commit
b0af0a287e
|
@ -440,62 +440,6 @@ describe("/rows", () => {
|
||||||
await assertRowUsage(rowUsage)
|
await assertRowUsage(rowUsage)
|
||||||
await assertQueryUsage(queryUsage)
|
await assertQueryUsage(queryUsage)
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("view row", () => {
|
|
||||||
it("should update only the fields that are supplied", async () => {
|
|
||||||
const existing = await config.createRow()
|
|
||||||
const view = await config.api.viewV2.create({
|
|
||||||
columns: { name: { visible: true } },
|
|
||||||
})
|
|
||||||
const searchResponse = await config.api.viewV2.search(view.id)
|
|
||||||
|
|
||||||
const [row] = searchResponse.body.rows as Row[]
|
|
||||||
|
|
||||||
const res = await config.api.row.patch(table._id!, {
|
|
||||||
...(row as PatchRowRequest),
|
|
||||||
name: "Updated Name",
|
|
||||||
description: "Updated Description",
|
|
||||||
})
|
|
||||||
|
|
||||||
const savedRow = await loadRow(res.body._id, table._id!)
|
|
||||||
|
|
||||||
expect(savedRow.body).toEqual({
|
|
||||||
...existing,
|
|
||||||
name: "Updated Name",
|
|
||||||
description: "Updated Description",
|
|
||||||
_rev: expect.anything(),
|
|
||||||
createdAt: expect.anything(),
|
|
||||||
updatedAt: expect.anything(),
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should not edit fields that don't belong to the view", async () => {
|
|
||||||
const existing = await config.createRow()
|
|
||||||
const view = await config.api.viewV2.create({
|
|
||||||
columns: { name: { visible: true } },
|
|
||||||
})
|
|
||||||
const searchResponse = await config.api.viewV2.search(view.id)
|
|
||||||
|
|
||||||
const [row] = searchResponse.body.rows as Row[]
|
|
||||||
|
|
||||||
const res = await config.api.row.patch(table._id!, {
|
|
||||||
...(row as PatchRowRequest),
|
|
||||||
name: "Updated Name",
|
|
||||||
description: "Updated Description",
|
|
||||||
})
|
|
||||||
|
|
||||||
const savedRow = await loadRow(res.body._id, table._id!)
|
|
||||||
|
|
||||||
expect(savedRow.body).toEqual({
|
|
||||||
...existing,
|
|
||||||
name: "Updated Name",
|
|
||||||
_rev: expect.anything(),
|
|
||||||
createdAt: expect.anything(),
|
|
||||||
updatedAt: expect.anything(),
|
|
||||||
})
|
|
||||||
expect(savedRow.body.description).not.toEqual("Updated Description")
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("destroy", () => {
|
describe("destroy", () => {
|
||||||
|
|
Loading…
Reference in New Issue