Add views

This commit is contained in:
Adria Navarro 2023-07-23 22:40:53 +02:00
parent d1d86b6803
commit 9cf401162b
1 changed files with 10 additions and 1 deletions

View File

@ -842,7 +842,7 @@ describe("/rows", () => {
})
})
it("when schema is defined, no other columns are returnd", async () => {
it("when schema is defined, no other columns are returned", async () => {
const table = await config.createTable(userTable())
const rows = []
for (let i = 0; i < 10; i++) {
@ -865,5 +865,14 @@ describe("/rows", () => {
expect.arrayContaining(rows.map(r => ({ name: r.name })))
)
})
it("views without data can be returned", async () => {
const table = await config.createTable(userTable())
const createViewResponse = await config.api.viewV2.create()
const response = await config.api.viewV2.search(createViewResponse.id)
expect(response.body.rows).toHaveLength(0)
})
})
})