Use api for view search tests
This commit is contained in:
parent
2feb22ef64
commit
6809bb4510
|
@ -717,11 +717,7 @@ describe("/rows", () => {
|
||||||
|
|
||||||
const createViewResponse = await config.api.viewV2.create()
|
const createViewResponse = await config.api.viewV2.create()
|
||||||
|
|
||||||
const response = await request
|
const response = await config.api.viewV2.search(createViewResponse._id!)
|
||||||
.get(`/api/v2/views/${createViewResponse._id}/search`)
|
|
||||||
.set(config.defaultHeaders())
|
|
||||||
.expect("Content-Type", /json/)
|
|
||||||
.expect(200)
|
|
||||||
|
|
||||||
expect(response.body.rows).toHaveLength(10)
|
expect(response.body.rows).toHaveLength(10)
|
||||||
expect(response.body).toEqual({
|
expect(response.body).toEqual({
|
||||||
|
|
|
@ -62,4 +62,12 @@ export class ViewV2API extends TestAPI {
|
||||||
.set(this.config.defaultHeaders())
|
.set(this.config.defaultHeaders())
|
||||||
.expect(expectStatus)
|
.expect(expectStatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
search = async (viewId: string, { expectStatus } = { expectStatus: 200 }) => {
|
||||||
|
return this.request
|
||||||
|
.get(`/api/v2/views/${viewId}/search`)
|
||||||
|
.set(this.config.defaultHeaders())
|
||||||
|
.expect("Content-Type", /json/)
|
||||||
|
.expect(expectStatus)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue