remove top level table config

This commit is contained in:
Peter Clement 2024-09-11 15:39:21 +01:00
parent 56b727a245
commit f377b9f566
1 changed files with 6 additions and 5 deletions

View File

@ -1,24 +1,23 @@
import * as automation from "../../index" import * as automation from "../../index"
import * as setup from "../utilities" import * as setup from "../utilities"
import { Table, LoopStepType, FieldType } from "@budibase/types" import { LoopStepType, FieldType } from "@budibase/types"
import { createAutomationBuilder } from "../utilities/AutomationTestBuilder" import { createAutomationBuilder } from "../utilities/AutomationTestBuilder"
import { DatabaseName } from "../../../integrations/tests/utils" import { DatabaseName } from "../../../integrations/tests/utils"
describe("Automation Scenarios", () => { describe("Automation Scenarios", () => {
let config = setup.getConfig(), let config = setup.getConfig()
table: Table
beforeEach(async () => { beforeEach(async () => {
await automation.init() await automation.init()
await config.init() await config.init()
table = await config.createTable()
await config.createRow()
}) })
afterAll(setup.afterAll) afterAll(setup.afterAll)
describe("Row Automations", () => { describe("Row Automations", () => {
it("should trigger an automation which then creates a row", async () => { it("should trigger an automation which then creates a row", async () => {
const table = await config.createTable()
const builder = createAutomationBuilder({ const builder = createAutomationBuilder({
name: "Test Row Save and Create", name: "Test Row Save and Create",
}) })
@ -53,6 +52,7 @@ describe("Automation Scenarios", () => {
}) })
it("should trigger an automation which querys the database", async () => { it("should trigger an automation which querys the database", async () => {
const table = await config.createTable()
const row = { const row = {
name: "Test Row", name: "Test Row",
description: "original description", description: "original description",
@ -76,6 +76,7 @@ describe("Automation Scenarios", () => {
}) })
it("should trigger an automation which querys the database then deletes a row", async () => { it("should trigger an automation which querys the database then deletes a row", async () => {
const table = await config.createTable()
const row = { const row = {
name: "DFN", name: "DFN",
description: "original description", description: "original description",