Test utils

This commit is contained in:
Adria Navarro 2024-08-26 14:37:29 +02:00
parent 922b746029
commit 568f5719c6
1 changed files with 18 additions and 0 deletions

View File

@ -2,6 +2,7 @@ import {
CreateRowActionRequest,
RowActionResponse,
RowActionsResponse,
RowActionTriggerRequest,
} from "@budibase/types"
import { Expectations, TestAPI } from "./base"
@ -102,4 +103,21 @@ export class RowActionAPI extends TestAPI {
}
)
}
trigger = async (
tableId: string,
rowActionId: string,
body: RowActionTriggerRequest,
expectations?: Expectations,
config?: { publicUser?: boolean }
) => {
return await this._post<RowActionResponse>(
`/api/tables/${tableId}/actions/${rowActionId}/trigger`,
{
body,
expectations,
...config,
}
)
}
}