Slim down postgres.spec.ts, most of its content is tested elsewhere now across all datasources.

This commit is contained in:
Sam Rose 2024-06-10 10:59:33 +01:00
parent ca370ba214
commit d579972e5f
No known key found for this signature in database
3 changed files with 19 additions and 1004 deletions

View File

@ -165,8 +165,17 @@ describe("/datasources", () => {
describe("get", () => {
it("should be able to get a datasource", async () => {
const ds = await config.api.datasource.get(datasource._id!)
expect(ds._id).toEqual(datasource._id)
expect(ds._rev).toBeDefined()
expect(ds).toEqual({
config: expect.any(Object),
plus: datasource.plus,
source: datasource.source,
isSQL: true,
type: "datasource_plus",
_id: datasource._id,
_rev: expect.any(String),
createdAt: expect.any(String),
updatedAt: expect.any(String),
})
})
it("should not return database password", async () => {

View File

@ -756,13 +756,16 @@ describe.each([
it("should be able to bulk delete rows, including a row that doesn't exist", async () => {
const createdRow = await config.api.row.save(table._id!, {})
const createdRow2 = await config.api.row.save(table._id!, {})
const res = await config.api.row.bulkDelete(table._id!, {
rows: [createdRow, { _id: "9999999" }],
rows: [createdRow, createdRow2, { _id: "9999999" }],
})
expect(res[0]._id).toEqual(createdRow._id)
expect(res.length).toEqual(1)
expect(res.map(r => r._id)).toEqual(
expect.arrayContaining([createdRow._id, createdRow2._id])
)
expect(res.length).toEqual(2)
})
})

File diff suppressed because it is too large Load Diff