Allow format on exportRows test utils
This commit is contained in:
parent
f7d47945ba
commit
8afb1e6c42
|
@ -33,6 +33,7 @@ import {
|
||||||
UpdatedRowEventEmitter,
|
UpdatedRowEventEmitter,
|
||||||
TableSchema,
|
TableSchema,
|
||||||
JsonFieldSubType,
|
JsonFieldSubType,
|
||||||
|
RowExportFormat,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import { generator, mocks } from "@budibase/backend-core/tests"
|
import { generator, mocks } from "@budibase/backend-core/tests"
|
||||||
import _, { merge } from "lodash"
|
import _, { merge } from "lodash"
|
||||||
|
@ -1811,6 +1812,7 @@ describe.each([
|
||||||
await config.api.row.exportRows(
|
await config.api.row.exportRows(
|
||||||
"1234567",
|
"1234567",
|
||||||
{ rows: [existing._id!] },
|
{ rows: [existing._id!] },
|
||||||
|
RowExportFormat.JSON,
|
||||||
{ status: 404 }
|
{ status: 404 }
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {
|
||||||
DeleteRows,
|
DeleteRows,
|
||||||
DeleteRow,
|
DeleteRow,
|
||||||
PaginatedSearchRowResponse,
|
PaginatedSearchRowResponse,
|
||||||
|
RowExportFormat,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import { Expectations, TestAPI } from "./base"
|
import { Expectations, TestAPI } from "./base"
|
||||||
|
|
||||||
|
@ -105,6 +106,7 @@ export class RowAPI extends TestAPI {
|
||||||
exportRows = async (
|
exportRows = async (
|
||||||
tableId: string,
|
tableId: string,
|
||||||
body: ExportRowsRequest,
|
body: ExportRowsRequest,
|
||||||
|
format: RowExportFormat = RowExportFormat.JSON,
|
||||||
expectations?: Expectations
|
expectations?: Expectations
|
||||||
) => {
|
) => {
|
||||||
const response = await this._requestRaw(
|
const response = await this._requestRaw(
|
||||||
|
@ -112,7 +114,7 @@ export class RowAPI extends TestAPI {
|
||||||
`/api/${tableId}/rows/exportRows`,
|
`/api/${tableId}/rows/exportRows`,
|
||||||
{
|
{
|
||||||
body,
|
body,
|
||||||
query: { format: "json" },
|
query: { format },
|
||||||
expectations,
|
expectations,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue