mock out pro call

This commit is contained in:
Peter Clement 2024-01-16 16:58:13 +00:00
parent 80c998b7e1
commit 61b34b3ead
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,12 @@
const actual = jest.requireActual("@budibase/pro")
const pro = {
...actual,
features: {
...actual.features,
isTriggerAutomationRunEnabled: () => {
return true
},
},
}
export = pro

View File

@ -34,7 +34,10 @@ describe("Test triggering an automation from another automation", () => {
it("should fail gracefully if the automation id is incorrect", async () => { it("should fail gracefully if the automation id is incorrect", async () => {
const inputs: any = { automation: { automationId: null, timeout: 12000 } } const inputs: any = { automation: { automationId: null, timeout: 12000 } }
const res = await setup.runStep(setup.actions.TRIGGER.stepId, inputs) const res = await setup.runStep(
setup.actions.TRIGGER_AUTOMATION_RUN.stepId,
inputs
)
expect(res.success).toBe(false) expect(res.success).toBe(false)
}) })
}) })