From 8afb1e6c420489a7f0d6f845c0dcca4c1b6186c3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 2 Aug 2024 10:52:48 +0200 Subject: [PATCH] Allow format on exportRows test utils --- packages/server/src/api/routes/tests/row.spec.ts | 2 ++ packages/server/src/tests/utilities/api/row.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/row.spec.ts b/packages/server/src/api/routes/tests/row.spec.ts index edceb925d6..b5e1e63910 100644 --- a/packages/server/src/api/routes/tests/row.spec.ts +++ b/packages/server/src/api/routes/tests/row.spec.ts @@ -33,6 +33,7 @@ import { UpdatedRowEventEmitter, TableSchema, JsonFieldSubType, + RowExportFormat, } from "@budibase/types" import { generator, mocks } from "@budibase/backend-core/tests" import _, { merge } from "lodash" @@ -1811,6 +1812,7 @@ describe.each([ await config.api.row.exportRows( "1234567", { rows: [existing._id!] }, + RowExportFormat.JSON, { status: 404 } ) }) diff --git a/packages/server/src/tests/utilities/api/row.ts b/packages/server/src/tests/utilities/api/row.ts index 17d21f0996..c5614d69e7 100644 --- a/packages/server/src/tests/utilities/api/row.ts +++ b/packages/server/src/tests/utilities/api/row.ts @@ -11,6 +11,7 @@ import { DeleteRows, DeleteRow, PaginatedSearchRowResponse, + RowExportFormat, } from "@budibase/types" import { Expectations, TestAPI } from "./base" @@ -105,6 +106,7 @@ export class RowAPI extends TestAPI { exportRows = async ( tableId: string, body: ExportRowsRequest, + format: RowExportFormat = RowExportFormat.JSON, expectations?: Expectations ) => { const response = await this._requestRaw( @@ -112,7 +114,7 @@ export class RowAPI extends TestAPI { `/api/${tableId}/rows/exportRows`, { body, - query: { format: "json" }, + query: { format }, expectations, } )