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 { CreateRowActionRequest, RowActionResponse } from "@budibase/types"
|
||||||
import * as setup from "./utilities"
|
import * as setup from "./utilities"
|
||||||
import { generator } from "@budibase/backend-core/tests"
|
import { generator } from "@budibase/backend-core/tests"
|
||||||
import { Expectations } from "src/tests/utilities/api/base"
|
|
||||||
|
|
||||||
describe("/rowsActions", () => {
|
describe("/rowsActions", () => {
|
||||||
const config = setup.getConfig()
|
const config = setup.getConfig()
|
||||||
|
@ -23,22 +22,7 @@ describe("/rowsActions", () => {
|
||||||
|
|
||||||
afterAll(setup.afterAll)
|
afterAll(setup.afterAll)
|
||||||
|
|
||||||
async function createRowAction(
|
const createRowAction = config.api.rowAction.save
|
||||||
tableId: string,
|
|
||||||
rowAction: CreateRowActionRequest,
|
|
||||||
expectations?: Expectations,
|
|
||||||
opts?: { publicUser?: boolean }
|
|
||||||
) {
|
|
||||||
return await config.api.rowAction.save(
|
|
||||||
tableId,
|
|
||||||
rowAction,
|
|
||||||
{
|
|
||||||
...expectations,
|
|
||||||
status: expectations?.status || 201,
|
|
||||||
},
|
|
||||||
opts
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
function createRowActionRequest(): CreateRowActionRequest {
|
function createRowActionRequest(): CreateRowActionRequest {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -16,7 +16,10 @@ export class RowActionAPI extends TestAPI {
|
||||||
`/api/tables/${tableId}/actions`,
|
`/api/tables/${tableId}/actions`,
|
||||||
{
|
{
|
||||||
body: rowAction,
|
body: rowAction,
|
||||||
expectations,
|
expectations: {
|
||||||
|
...expectations,
|
||||||
|
status: expectations?.status || 201,
|
||||||
|
},
|
||||||
...config,
|
...config,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue