Skip to content

Commit 16efc78

Browse files
authored
Merge pull request #16732 from Budibase/chore/allow-running-disabled-automations-for-testing
Allow testing disabled apps
2 parents 780e232 + cdac174 commit 16efc78

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

packages/server/src/api/controllers/automation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export async function test(
251251
const input = prepareTestInput(body)
252252
const user = sdk.users.getUserContextBindings(ctx.user)
253253
return await triggers.externalTrigger(
254-
automation,
254+
{ ...automation, disabled: false },
255255
{ ...{ ...input, ...(table ? { table } : {}) }, appId, user },
256256
{ getResponses: true }
257257
)

packages/server/src/api/routes/tests/automation.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,20 @@ describe("/automations", () => {
300300
}
301301
throw "Failed to find the rows"
302302
})
303+
304+
it("should be able to test a disabled automation", async () => {
305+
const { automation } = await config.api.automation.post(
306+
collectAutomation({ disabled: true })
307+
)
308+
309+
await config.api.automation.test(automation._id!, {
310+
fields: {},
311+
})
312+
313+
expect(sdk.automations.utils.checkForCollectStep(automation)).toEqual(
314+
true
315+
)
316+
})
303317
})
304318

305319
describe("trigger", () => {

0 commit comments

Comments
 (0)