1
0
Fork 0
mirror of synced 2024-09-24 21:31:17 +12:00

Add a test for row exports on Google Sheets.

This commit is contained in:
Sam Rose 2024-09-16 16:36:17 +01:00
parent 4d0f84fdeb
commit 27f6fa7de4
No known key found for this signature in database

View file

@ -10,6 +10,7 @@ import {
TableSourceType,
} from "@budibase/types"
import { GoogleSheetsMock } from "./utils/googlesheets"
import rows from "src/sdk/app/rows"
describe("Google Sheets Integration", () => {
const config = new TestConfiguration()
@ -244,6 +245,20 @@ describe("Google Sheets Integration", () => {
expect.arrayContaining(Array.from({ length: 248 }, (_, i) => `${i}`))
)
})
it("can export rows", async () => {
const resp = await config.api.row.exportRows(table._id!, {})
const parsed = JSON.parse(resp)
expect(parsed.length).toEqual(2)
expect(parsed[0]).toMatchObject({
name: "Test Contact 1",
description: "original description 1",
})
expect(parsed[1]).toMatchObject({
name: "Test Contact 2",
description: "original description 2",
})
})
})
describe("update", () => {