Skip to content

Commit

Permalink
Updating tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mike12345567 committed Jul 3, 2024
1 parent cb41e4d commit 378bf6d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/server/src/integrations/tests/couchdb.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ jest.mock("@budibase/backend-core", () => {
...core.db,
DatabaseWithConnection: function () {
return {
post: jest.fn(),
allDocs: jest.fn().mockReturnValue({ rows: [] }),
put: jest.fn(),
get: jest.fn().mockReturnValue({ _rev: "a" }),
Expand Down Expand Up @@ -43,7 +42,7 @@ describe("CouchDB Integration", () => {
await config.integration.create({
json: JSON.stringify(doc),
})
expect(config.integration.client.post).toHaveBeenCalledWith(doc)
expect(config.integration.client.put).toHaveBeenCalledWith(doc)
})

it("calls the read method with the correct params", async () => {
Expand Down Expand Up @@ -80,7 +79,6 @@ describe("CouchDB Integration", () => {
it("calls the delete method with the correct params", async () => {
const id = "1234"
await config.integration.delete({ id })
expect(config.integration.client.get).toHaveBeenCalledWith(id)
expect(config.integration.client.remove).toHaveBeenCalled()
expect(config.integration.client.remove).toHaveBeenCalledWith(id)
})
})

0 comments on commit 378bf6d

Please sign in to comment.