Allow running api prod tests

This commit is contained in:
Adria Navarro 2024-08-26 15:09:45 +02:00
parent 610621823c
commit e93934111f
2 changed files with 4 additions and 2 deletions

View File

@ -40,6 +40,7 @@ export interface RequestOpts {
>
expectations?: Expectations
publicUser?: boolean
useProdApp?: boolean
}
export abstract class TestAPI {
@ -108,7 +109,8 @@ export abstract class TestAPI {
const headersFn = publicUser
? this.config.publicHeaders.bind(this.config)
: this.config.defaultHeaders.bind(this.config)
: (extras = {}) =>
this.config.defaultHeaders.bind(this.config)(extras, opts?.useProdApp)
const app = getServer()
let req = request(app)[method](url)

View File

@ -109,7 +109,7 @@ export class RowActionAPI extends TestAPI {
rowActionId: string,
body: RowActionTriggerRequest,
expectations?: Expectations,
config?: { publicUser?: boolean }
config?: { publicUser?: boolean; useProdApp?: boolean }
) => {
return await this._post<RowActionResponse>(
`/api/tables/${tableId}/actions/${rowActionId}/trigger`,