Cleanup sqs flags from tests
This commit is contained in:
parent
b15b0fb2ae
commit
dfbebe1c79
|
@ -2,7 +2,6 @@ import * as setup from "./utilities"
|
|||
import path from "path"
|
||||
import nock from "nock"
|
||||
import { generator } from "@budibase/backend-core/tests"
|
||||
import { features } from "@budibase/backend-core"
|
||||
|
||||
interface App {
|
||||
background: string
|
||||
|
@ -82,48 +81,36 @@ describe("/templates", () => {
|
|||
})
|
||||
|
||||
describe("create app from template", () => {
|
||||
it.each(["sqs", "lucene"])(
|
||||
`should be able to create an app from a template (%s)`,
|
||||
async source => {
|
||||
await features.testutils.withFeatureFlags(
|
||||
"*",
|
||||
{ SQS: source === "sqs" },
|
||||
async () => {
|
||||
const name = generator.guid().replaceAll("-", "")
|
||||
const url = `/${name}`
|
||||
it("should be able to create an app from a template", async () => {
|
||||
const name = generator.guid().replaceAll("-", "")
|
||||
const url = `/${name}`
|
||||
|
||||
const app = await config.api.application.create({
|
||||
name,
|
||||
url,
|
||||
useTemplate: "true",
|
||||
templateName: "Agency Client Portal",
|
||||
templateKey: "app/agency-client-portal",
|
||||
})
|
||||
expect(app.name).toBe(name)
|
||||
expect(app.url).toBe(url)
|
||||
const app = await config.api.application.create({
|
||||
name,
|
||||
url,
|
||||
useTemplate: "true",
|
||||
templateName: "Agency Client Portal",
|
||||
templateKey: "app/agency-client-portal",
|
||||
})
|
||||
expect(app.name).toBe(name)
|
||||
expect(app.url).toBe(url)
|
||||
|
||||
await config.withApp(app, async () => {
|
||||
const tables = await config.api.table.fetch()
|
||||
expect(tables).toHaveLength(2)
|
||||
await config.withApp(app, async () => {
|
||||
const tables = await config.api.table.fetch()
|
||||
expect(tables).toHaveLength(2)
|
||||
|
||||
tables.sort((a, b) => a.name.localeCompare(b.name))
|
||||
const [agencyProjects, users] = tables
|
||||
expect(agencyProjects.name).toBe("Agency Projects")
|
||||
expect(users.name).toBe("Users")
|
||||
tables.sort((a, b) => a.name.localeCompare(b.name))
|
||||
const [agencyProjects, users] = tables
|
||||
expect(agencyProjects.name).toBe("Agency Projects")
|
||||
expect(users.name).toBe("Users")
|
||||
|
||||
const { rows } = await config.api.row.search(
|
||||
agencyProjects._id!,
|
||||
{
|
||||
tableId: agencyProjects._id!,
|
||||
query: {},
|
||||
}
|
||||
)
|
||||
const { rows } = await config.api.row.search(agencyProjects._id!, {
|
||||
tableId: agencyProjects._id!,
|
||||
query: {},
|
||||
})
|
||||
|
||||
expect(rows).toHaveLength(3)
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
expect(rows).toHaveLength(3)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue