diff --git a/src/components/administration/AdminMigrationSection.unit.ts b/src/components/administration/AdminMigrationSection.unit.ts index c15317ef5b..2fe81da999 100644 --- a/src/components/administration/AdminMigrationSection.unit.ts +++ b/src/components/administration/AdminMigrationSection.unit.ts @@ -1,7 +1,8 @@ import AdminMigrationSection from "@/components/administration/AdminMigrationSection.vue"; +import * as useUserLoginMigrationMappingsComposable from "@/composables/user-login-migration-mappings.composable"; +import { ConfigResponse } from "@/serverApi/v3/api"; import EnvConfigModule from "@/store/env-config"; import SchoolsModule from "@/store/schools"; -import { ConfigResponse } from "@/serverApi/v3/api"; import UserLoginMigrationModule from "@/store/user-login-migrations"; import { ENV_CONFIG_MODULE_KEY, @@ -9,6 +10,7 @@ import { USER_LOGIN_MIGRATION_MODULE_KEY, } from "@/utils/inject"; import { createModuleMocks } from "@/utils/mock-store-module"; +import { businessErrorFactory } from "@@/tests/test-utils"; import { mockSchool } from "@@/tests/test-utils/mockObjects"; import { createTestingI18n, @@ -17,8 +19,6 @@ import { import { mount } from "@vue/test-utils"; import { nextTick } from "vue"; import vueDompurifyHTMLPlugin from "vue-dompurify-html"; -import * as useUserLoginMigrationMappingsComposable from "@/composables/user-login-migration-mappings.composable"; -import { businessErrorFactory } from "@@/tests/test-utils"; describe("AdminMigrationSection", () => { let schoolsModule: jest.Mocked; @@ -1046,6 +1046,32 @@ describe("AdminMigrationSection", () => { }); }); + describe("when the migration has been finished", () => { + it("should not be visible", () => { + const { wrapper } = setup( + {}, + { + getUserLoginMigration: { + sourceSystemId: "sourceSystemId", + targetSystemId: "targetSystemId", + startedAt: new Date(2023, 1, 1), + closedAt: new Date(2023, 1, 2), + finishedAt: new Date(2023, 1, 3), + mandatorySince: undefined, + }, + }, + { + getEnv: { FEATURE_SHOW_MIGRATION_WIZARD: true } as ConfigResponse, + } + ); + + const migrationWizardButton = wrapper.find( + '[data-testid="migration-wizard-button]' + ); + expect(migrationWizardButton.exists()).toBeFalsy(); + }); + }); + describe("when the school has not been migrated", () => { it("should be disabled", () => { const { wrapper } = setup( diff --git a/src/components/administration/AdminMigrationSection.vue b/src/components/administration/AdminMigrationSection.vue index 7ec70cb024..f9abcf27a2 100644 --- a/src/components/administration/AdminMigrationSection.vue +++ b/src/components/administration/AdminMigrationSection.vue @@ -150,7 +150,7 @@ @update:model-value="setSchoolFeatures" /> -