Merge branch 'feature/app-backups' of github.com:Budibase/budibase into feature/app-backups
This commit is contained in:
commit
8b70abf846
2 changed files with 1 additions and 16 deletions
|
@ -108,7 +108,7 @@ async function deployApp(deployment: any, userId: string) {
|
|||
const productionAppId = getProdAppID(appId)
|
||||
|
||||
// don't try this if feature isn't allowed, will error
|
||||
if (!(await backups.isEnabled())) {
|
||||
if (await backups.isEnabled()) {
|
||||
// trigger backup initially
|
||||
await backups.triggerAppBackup(
|
||||
productionAppId,
|
||||
|
|
|
@ -1,14 +1,5 @@
|
|||
const triggerAppBackupMock = jest.fn()
|
||||
jest.mock("@budibase/pro", () => ({
|
||||
...jest.requireActual("@budibase/pro"),
|
||||
backups: {
|
||||
triggerAppBackup: triggerAppBackupMock,
|
||||
addAppBackupProcessors: jest.fn(),
|
||||
},
|
||||
}))
|
||||
import setup from "./utilities"
|
||||
import { events } from "@budibase/backend-core"
|
||||
import { AppBackupTrigger } from "@budibase/types"
|
||||
|
||||
describe("/deployments", () => {
|
||||
let request = setup.getRequest()
|
||||
|
@ -28,12 +19,6 @@ describe("/deployments", () => {
|
|||
.set(config.defaultHeaders())
|
||||
.expect("Content-Type", /json/)
|
||||
.expect(200)
|
||||
expect(triggerAppBackupMock).toBeCalledTimes(1)
|
||||
expect(triggerAppBackupMock).toBeCalledWith(
|
||||
config.prodAppId,
|
||||
AppBackupTrigger.PUBLISH,
|
||||
{ createdBy: config.userMetadataId }
|
||||
)
|
||||
expect((events.app.published as jest.Mock).mock.calls.length).toBe(1)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue