Fix test to remove invalid definitions.
This commit is contained in:
parent
76652ddab5
commit
7a68db4274
|
@ -14,6 +14,7 @@ import sdk from "../../../sdk"
|
||||||
import { Automation, FieldType, Table } from "@budibase/types"
|
import { Automation, FieldType, Table } from "@budibase/types"
|
||||||
import { mocks } from "@budibase/backend-core/tests"
|
import { mocks } from "@budibase/backend-core/tests"
|
||||||
import { FilterConditions } from "../../../automations/steps/filter"
|
import { FilterConditions } from "../../../automations/steps/filter"
|
||||||
|
import { removeInvalidDefinitions } from "../../../automations/utils"
|
||||||
|
|
||||||
const MAX_RETRIES = 4
|
const MAX_RETRIES = 4
|
||||||
let {
|
let {
|
||||||
|
@ -69,14 +70,15 @@ describe("/automations", () => {
|
||||||
.expect("Content-Type", /json/)
|
.expect("Content-Type", /json/)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
|
|
||||||
let definitionsLength = Object.keys(BUILTIN_ACTION_DEFINITIONS).length
|
let definitionsLength = Object.keys(
|
||||||
definitionsLength-- // OUTGOING_WEBHOOK is deprecated
|
removeInvalidDefinitions(BUILTIN_ACTION_DEFINITIONS)
|
||||||
|
).length
|
||||||
|
|
||||||
expect(Object.keys(res.body.action).length).toBeGreaterThanOrEqual(
|
expect(Object.keys(res.body.action).length).toBeGreaterThanOrEqual(
|
||||||
definitionsLength
|
definitionsLength
|
||||||
)
|
)
|
||||||
expect(Object.keys(res.body.trigger).length).toEqual(
|
expect(Object.keys(res.body.trigger).length).toEqual(
|
||||||
Object.keys(TRIGGER_DEFINITIONS).length
|
Object.keys(removeInvalidDefinitions(TRIGGER_DEFINITIONS)).length
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue