Fix test to remove invalid definitions.

This commit is contained in:
mike12345567 2024-07-30 15:33:43 +01:00
parent 76652ddab5
commit 7a68db4274
1 changed files with 5 additions and 3 deletions

View File

@ -14,6 +14,7 @@ import sdk from "../../../sdk"
import { Automation, FieldType, Table } from "@budibase/types"
import { mocks } from "@budibase/backend-core/tests"
import { FilterConditions } from "../../../automations/steps/filter"
import { removeInvalidDefinitions } from "../../../automations/utils"
const MAX_RETRIES = 4
let {
@ -69,14 +70,15 @@ describe("/automations", () => {
.expect("Content-Type", /json/)
.expect(200)
let definitionsLength = Object.keys(BUILTIN_ACTION_DEFINITIONS).length
definitionsLength-- // OUTGOING_WEBHOOK is deprecated
let definitionsLength = Object.keys(
removeInvalidDefinitions(BUILTIN_ACTION_DEFINITIONS)
).length
expect(Object.keys(res.body.action).length).toBeGreaterThanOrEqual(
definitionsLength
)
expect(Object.keys(res.body.trigger).length).toEqual(
Object.keys(TRIGGER_DEFINITIONS).length
Object.keys(removeInvalidDefinitions(TRIGGER_DEFINITIONS)).length
)
})
})