Fix failing table test

This commit is contained in:
Pedro Silva 2023-05-16 19:07:05 +01:00
parent bc1d1862b5
commit b6267e0f96
2 changed files with 11 additions and 3 deletions

View File

@ -44,8 +44,12 @@ export default class BaseAPI {
return [response, json]
}
async del(url: string, statusCode?: number): Promise<[Response, any]> {
const [response, json] = await this.client.del(url)
async del(
url: string,
statusCode?: number,
body?: any
): Promise<[Response, any]> {
const [response, json] = await this.client.del(url, { body })
expect(response).toHaveStatusCode(statusCode ? statusCode : 200)
return [response, json]
}

View File

@ -28,7 +28,11 @@ export default class RowAPI extends BaseAPI {
}
async delete(tableId: string, body: any): Promise<[Response, Row[]]> {
const [response, json] = await this.del(`/${tableId}/rows/`, body)
const [response, json] = await this.del(
`/${tableId}/rows/`,
undefined,
body
)
return [response, json]
}