Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrinr committed Sep 3, 2024
1 parent 5ac5a63 commit c830e2a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/server/src/api/routes/tests/rowAction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ describe("/rowsActions", () => {
}

it("can trigger an automation given valid data", async () => {
expect(await getAutomationLogs()).toBeEmpty()
await config.api.rowAction.trigger(tableId, rowAction.id, {
rowId: row._id!,
})
Expand All @@ -680,13 +681,19 @@ describe("/rowsActions", () => {
expect(automationLogs).toEqual([
expect.objectContaining({
automationId: rowAction.automationId,
trigger: expect.objectContaining({
trigger: {
id: "trigger",
stepId: "ROW_ACTION",
inputs: null,
outputs: {
fields: {},
row: await config.api.row.get(tableId, row._id!),
table: await config.api.table.get(tableId),
automation: expect.objectContaining({
_id: rowAction.automationId,
}),
},
}),
},
}),
])
})
Expand Down Expand Up @@ -731,6 +738,7 @@ describe("/rowsActions", () => {
)

await config.publish()
expect(await getAutomationLogs()).toBeEmpty()
await config.api.rowAction.trigger(viewId, rowAction.id, {
rowId: row._id!,
})
Expand Down

0 comments on commit c830e2a

Please sign in to comment.