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
1 changed files with 15 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import {
TableSourceType, TableSourceType,
} from "@budibase/types" } from "@budibase/types"
import { GoogleSheetsMock } from "./utils/googlesheets" import { GoogleSheetsMock } from "./utils/googlesheets"
import rows from "src/sdk/app/rows"
describe("Google Sheets Integration", () => { describe("Google Sheets Integration", () => {
const config = new TestConfiguration() const config = new TestConfiguration()
@ -244,6 +245,20 @@ describe("Google Sheets Integration", () => {
expect.arrayContaining(Array.from({ length: 248 }, (_, i) => `${i}`)) 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", () => { describe("update", () => {