Clean code

This commit is contained in:
Adria Navarro 2024-07-17 11:15:55 +02:00
parent 9a7470a943
commit b1cfdc4f25
2 changed files with 5 additions and 18 deletions

View File

@ -4,7 +4,6 @@ import tk from "timekeeper"
import { CreateRowActionRequest, RowActionResponse } from "@budibase/types"
import * as setup from "./utilities"
import { generator } from "@budibase/backend-core/tests"
import { Expectations } from "src/tests/utilities/api/base"
describe("/rowsActions", () => {
const config = setup.getConfig()
@ -23,22 +22,7 @@ describe("/rowsActions", () => {
afterAll(setup.afterAll)
async function createRowAction(
tableId: string,
rowAction: CreateRowActionRequest,
expectations?: Expectations,
opts?: { publicUser?: boolean }
) {
return await config.api.rowAction.save(
tableId,
rowAction,
{
...expectations,
status: expectations?.status || 201,
},
opts
)
}
const createRowAction = config.api.rowAction.save
function createRowActionRequest(): CreateRowActionRequest {
return {

View File

@ -16,7 +16,10 @@ export class RowActionAPI extends TestAPI {
`/api/tables/${tableId}/actions`,
{
body: rowAction,
expectations,
expectations: {
...expectations,
status: expectations?.status || 201,
},
...config,
}
)