From e93934111f10c4172ec44b6aa489a8c0c56bd909 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 26 Aug 2024 15:09:45 +0200 Subject: [PATCH] Allow running api prod tests --- packages/server/src/tests/utilities/api/base.ts | 4 +++- packages/server/src/tests/utilities/api/rowAction.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/tests/utilities/api/base.ts b/packages/server/src/tests/utilities/api/base.ts index 3a5f6529f8..b38f8eb56f 100644 --- a/packages/server/src/tests/utilities/api/base.ts +++ b/packages/server/src/tests/utilities/api/base.ts @@ -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) diff --git a/packages/server/src/tests/utilities/api/rowAction.ts b/packages/server/src/tests/utilities/api/rowAction.ts index 6bcf661076..0f67205ca5 100644 --- a/packages/server/src/tests/utilities/api/rowAction.ts +++ b/packages/server/src/tests/utilities/api/rowAction.ts @@ -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( `/api/tables/${tableId}/actions/${rowActionId}/trigger`,