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 expectations?: Expectations
publicUser?: boolean publicUser?: boolean
useProdApp?: boolean
} }
export abstract class TestAPI { export abstract class TestAPI {
@ -108,7 +109,8 @@ export abstract class TestAPI {
const headersFn = publicUser const headersFn = publicUser
? this.config.publicHeaders.bind(this.config) ? 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() const app = getServer()
let req = request(app)[method](url) let req = request(app)[method](url)

View File

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