Reuse config
This commit is contained in:
parent
97a538f5db
commit
9f36bdc6c1
|
@ -687,7 +687,7 @@ describe("/rows", () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe.only("view search", () => {
|
describe("view search", () => {
|
||||||
function priceTable(): Table {
|
function priceTable(): Table {
|
||||||
return {
|
return {
|
||||||
name: "table",
|
name: "table",
|
||||||
|
@ -711,24 +711,14 @@ describe("/rows", () => {
|
||||||
|
|
||||||
it("returns table rows from view", async () => {
|
it("returns table rows from view", async () => {
|
||||||
const table = await config.createTable(priceTable())
|
const table = await config.createTable(priceTable())
|
||||||
const rows = await Promise.all(
|
const rows = []
|
||||||
Array(10)
|
for (let i = 0; i < 10; i++)
|
||||||
.fill({})
|
rows.push(await config.createRow({ tableId: table._id }))
|
||||||
.map(() => config.createRow({ tableId: table._id }))
|
|
||||||
)
|
const createViewResponse = await config.api.viewV2.create()
|
||||||
const view: ViewV2 = {
|
|
||||||
name: generator.guid(),
|
|
||||||
tableId: table._id!,
|
|
||||||
}
|
|
||||||
const createViewResponse = await request
|
|
||||||
.post(`/api/views/v2`)
|
|
||||||
.send(view)
|
|
||||||
.set(config.defaultHeaders())
|
|
||||||
.expect("Content-Type", /json/)
|
|
||||||
.expect(200)
|
|
||||||
|
|
||||||
const response = await request
|
const response = await request
|
||||||
.get(`/api/views/v2/${createViewResponse.body._id}/search`)
|
.get(`/api/views/v2/${createViewResponse._id}/search`)
|
||||||
.set(config.defaultHeaders())
|
.set(config.defaultHeaders())
|
||||||
.expect("Content-Type", /json/)
|
.expect("Content-Type", /json/)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
|
|
Loading…
Reference in New Issue