From e11c3f87c437246e5d9506b941ffb4e4cf069e0d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 13 Dec 2024 18:15:08 +0000 Subject: [PATCH] Fixing issue with webhook test case - getting sync response back. --- .../src/automations/tests/scenarios/webhook.spec.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/server/src/automations/tests/scenarios/webhook.spec.ts b/packages/server/src/automations/tests/scenarios/webhook.spec.ts index 5f2f01ec1d..cb15a96824 100644 --- a/packages/server/src/automations/tests/scenarios/webhook.spec.ts +++ b/packages/server/src/automations/tests/scenarios/webhook.spec.ts @@ -2,6 +2,9 @@ import * as automation from "../../index" import * as setup from "../utilities" import { Table, Webhook, WebhookActionType } from "@budibase/types" import { createAutomationBuilder } from "../utilities/AutomationTestBuilder" +import { mocks } from "@budibase/backend-core/tests" + +mocks.licenses.useSyncAutomations() describe("Branching automations", () => { let config = setup.getConfig(), @@ -32,6 +35,7 @@ describe("Branching automations", () => { await config.api.webhook.buildSchema(config.getAppId(), webhook._id!, { parameter: "string", }) + await config.publish() return { webhook, automation } } @@ -48,12 +52,14 @@ describe("Branching automations", () => { "Check a basic webhook works as expected" ) const res = await config.api.webhook.trigger( - config.getAppId(), + config.getProdAppId(), webhook._id!, { parameter: "testing", } ) - expect(res).toBeDefined() + expect(typeof res).toBe("object") + const collectedInfo = res as Record + expect(collectedInfo.value).toEqual("testing") }) })