Clean code
This commit is contained in:
parent
9a7470a943
commit
b1cfdc4f25
|
@ -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 {
|
||||
|
|
|
@ -16,7 +16,10 @@ export class RowActionAPI extends TestAPI {
|
|||
`/api/tables/${tableId}/actions`,
|
||||
{
|
||||
body: rowAction,
|
||||
expectations,
|
||||
expectations: {
|
||||
...expectations,
|
||||
status: expectations?.status || 201,
|
||||
},
|
||||
...config,
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue