Fix tests (breaking because of mutating objects...)
This commit is contained in:
parent
166d8fac5e
commit
812afdb85e
|
@ -267,8 +267,7 @@ describe("/automations", () => {
|
|||
}
|
||||
|
||||
it("updates a automations name", async () => {
|
||||
let automation = newAutomation()
|
||||
await config.createAutomation(automation)
|
||||
const automation = await config.createAutomation(newAutomation())
|
||||
automation.name = "Updated Name"
|
||||
jest.clearAllMocks()
|
||||
|
||||
|
@ -294,8 +293,7 @@ describe("/automations", () => {
|
|||
})
|
||||
|
||||
it("updates a automations name using POST request", async () => {
|
||||
let automation = newAutomation()
|
||||
await config.createAutomation(automation)
|
||||
const automation = await config.createAutomation(newAutomation())
|
||||
automation.name = "Updated Name"
|
||||
jest.clearAllMocks()
|
||||
|
||||
|
@ -392,8 +390,7 @@ describe("/automations", () => {
|
|||
describe("fetch", () => {
|
||||
it("return all the automations for an instance", async () => {
|
||||
await clearAllAutomations(config)
|
||||
const autoConfig = basicAutomation()
|
||||
await config.createAutomation(autoConfig)
|
||||
const autoConfig = await config.createAutomation(basicAutomation())
|
||||
const res = await request
|
||||
.get(`/api/automations`)
|
||||
.set(config.defaultHeaders())
|
||||
|
|
|
@ -159,7 +159,7 @@ export function automationTrigger(
|
|||
}
|
||||
|
||||
export function newAutomation({ steps, trigger }: any = {}) {
|
||||
const automation: any = basicAutomation()
|
||||
const automation = basicAutomation()
|
||||
|
||||
if (trigger) {
|
||||
automation.definition.trigger = trigger
|
||||
|
|
Loading…
Reference in New Issue