Fix test
This commit is contained in:
parent
b85a28fdf6
commit
f07cb6bd74
|
@ -21,6 +21,7 @@ import tk from "timekeeper"
|
||||||
import * as uuid from "uuid"
|
import * as uuid from "uuid"
|
||||||
import { structures } from "@budibase/backend-core/tests"
|
import { structures } from "@budibase/backend-core/tests"
|
||||||
import nock from "nock"
|
import nock from "nock"
|
||||||
|
import path from "path"
|
||||||
|
|
||||||
describe("/applications", () => {
|
describe("/applications", () => {
|
||||||
let config = setup.getConfig()
|
let config = setup.getConfig()
|
||||||
|
@ -137,10 +138,17 @@ describe("/applications", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("creates app from template", async () => {
|
it("creates app from template", async () => {
|
||||||
|
nock("https://prod-budi-templates.s3-eu-west-1.amazonaws.com")
|
||||||
|
.get(`/templates/app/agency-client-portal.tar.gz`)
|
||||||
|
.replyWithFile(
|
||||||
|
200,
|
||||||
|
path.resolve(__dirname, "data", "agency-client-portal.tar.gz")
|
||||||
|
)
|
||||||
|
|
||||||
const app = await config.api.application.create({
|
const app = await config.api.application.create({
|
||||||
name: utils.newid(),
|
name: utils.newid(),
|
||||||
useTemplate: "true",
|
useTemplate: "true",
|
||||||
templateKey: "test",
|
templateKey: "app/agency-client-portal",
|
||||||
})
|
})
|
||||||
expect(app._id).toBeDefined()
|
expect(app._id).toBeDefined()
|
||||||
expect(events.app.created).toHaveBeenCalledTimes(1)
|
expect(events.app.created).toHaveBeenCalledTimes(1)
|
||||||
|
|
Loading…
Reference in New Issue