diff --git a/packages/server/src/appMigrations/tests/migrations.spec.ts b/packages/server/src/appMigrations/tests/migrations.spec.ts index 9d80cc5f99..9b1a0a9dd8 100644 --- a/packages/server/src/appMigrations/tests/migrations.spec.ts +++ b/packages/server/src/appMigrations/tests/migrations.spec.ts @@ -1,8 +1,21 @@ import { context } from "@budibase/backend-core" import * as setup from "../../api/routes/tests/utilities" import { MIGRATIONS } from "../migrations" +import { getAppMigrationVersion } from "../appMigrationMetadata" +import { latestMigration } from ".." + +describe("migrations", () => { + it("new apps are created with the latest app migration version set", async () => { + const config = setup.getConfig() + await config.init() + + await config.doInContext(config.getAppId(), async () => { + const migrationVersion = await getAppMigrationVersion(config.getAppId()) + + expect(migrationVersion).toEqual(latestMigration) + }) + }) -describe("migration", () => { // These test is checking that each migration is "idempotent". // We should be able to rerun any migration, with any rerun not modifiying anything. The code should be aware that the migration already ran it("each migration can rerun safely", async () => {