Add view tests
This commit is contained in:
parent
3acc9bde45
commit
331e8eb7be
|
@ -1602,6 +1602,28 @@ describe.each([
|
||||||
})
|
})
|
||||||
expect(response.rows).toHaveLength(0)
|
expect(response.rows).toHaveLength(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("queries the row api passing the view fields only", async () => {
|
||||||
|
const searchSpy = jest.spyOn(sdk.rows, "search")
|
||||||
|
|
||||||
|
const view = await config.api.viewV2.create({
|
||||||
|
tableId: table._id!,
|
||||||
|
name: generator.guid(),
|
||||||
|
schema: {
|
||||||
|
id: { visible: true },
|
||||||
|
one: { visible: false },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
await config.api.viewV2.search(view.id, { query: {} })
|
||||||
|
expect(searchSpy).toHaveBeenCalledTimes(1)
|
||||||
|
|
||||||
|
expect(searchSpy).toHaveBeenCalledWith(
|
||||||
|
expect.objectContaining({
|
||||||
|
fields: ["id"],
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("permissions", () => {
|
describe("permissions", () => {
|
||||||
|
|
Loading…
Reference in New Issue