From fa2e68c30db046e7c7b05a04b707e2fb8214f30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20=C3=96hlerking?= Date: Wed, 26 Feb 2025 15:51:11 +0100 Subject: [PATCH 1/2] change sanis to schulconnex/moin.schule --- .../SchoolSettings.page.unit.ts | 32 +++++----- .../administration/SchoolSettings.page.vue | 12 ++-- .../administration/StudentOverview.page.vue | 8 +-- .../administration/TeacherOverview.page.vue | 6 +- .../administration/student-overview.unit.js | 16 ++--- .../administration/teacher-overview.unit.js | 16 ++--- src/serverApi/v3/api.ts | 61 ++++++++++++++++--- src/store/env-config-defaults.ts | 2 +- src/store/env-config.ts | 12 ---- src/store/env-config.unit.ts | 29 --------- 10 files changed, 101 insertions(+), 93 deletions(-) diff --git a/src/pages/administration/SchoolSettings.page.unit.ts b/src/pages/administration/SchoolSettings.page.unit.ts index d67191fcb5..f74230bf56 100644 --- a/src/pages/administration/SchoolSettings.page.unit.ts +++ b/src/pages/administration/SchoolSettings.page.unit.ts @@ -1,19 +1,21 @@ -import SchoolSettings from "./SchoolSettings.page.vue"; +import { useApplicationError } from "@/composables/application-error.composable"; +import { ConfigResponse, SchoolSystemResponse } from "@/serverApi/v3"; import EnvConfigModule from "@/store/env-config"; import SchoolsModule from "@/store/schools"; -import { createModuleMocks } from "@@/tests/test-utils/mock-store-module"; -import { shallowMount } from "@vue/test-utils"; import { FederalState } from "@/store/types/schools"; -import { mockSchool } from "@@/tests/test-utils/mockObjects"; import { ENV_CONFIG_MODULE_KEY, SCHOOLS_MODULE_KEY } from "@/utils/inject"; -import { useApplicationError } from "@/composables/application-error.composable"; -import { RouteLocationNormalizedLoaded, useRoute } from "vue-router"; +import { createModuleMocks } from "@@/tests/test-utils/mock-store-module"; +import { mockSchool } from "@@/tests/test-utils/mockObjects"; import { createTestingI18n, createTestingVuetify, } from "@@/tests/test-utils/setup"; +import { shallowMount } from "@vue/test-utils"; import { nextTick, reactive } from "vue"; -import { SchoolSystemResponse } from "@/serverApi/v3"; +import { RouteLocationNormalizedLoaded, useRoute } from "vue-router"; +import { envsFactory } from "../../../tests/test-utils"; +import SchoolSettings from "./SchoolSettings.page.vue"; + jest.mock("vue-router"); const useRouteMock = >>( @@ -55,10 +57,10 @@ describe("SchoolSettingsPage", () => { ]; const setup = ( - envConfigGetters: Partial = { - getFeatureSchoolSanisUserMigrationEnabled: true, - getSchoolPolicyEnabled: true, - getSchoolTermsOfUseEnabled: true, + envConfig: Partial = { + FEATURE_USER_LOGIN_MIGRATION_ENABLED: true, + FEATURE_SCHOOL_POLICY_ENABLED_NEW: true, + FEATURE_SCHOOL_TERMS_OF_USE_ENABLED: true, }, schoolGetters: Partial = {} ) => { @@ -76,7 +78,7 @@ describe("SchoolSettingsPage", () => { }); envConfigModule = createModuleMocks(EnvConfigModule, { - ...envConfigGetters, + getEnv: envsFactory.build(envConfig), }); useRouteMock.mockImplementation(() => @@ -107,7 +109,7 @@ describe("SchoolSettingsPage", () => { describe("when feature school policy is disabled", () => { it("should not render privacy policy expansion panel", () => { const { wrapper } = setup({ - getSchoolPolicyEnabled: false, + FEATURE_SCHOOL_POLICY_ENABLED_NEW: false, }); expect(wrapper.find('[data-testid="policy-panel"]').exists()).toBe(false); @@ -125,7 +127,7 @@ describe("SchoolSettingsPage", () => { describe("when feature school terms of use is disabled", () => { it("should not render terms of use expansion panel", () => { const { wrapper } = setup({ - getSchoolTermsOfUseEnabled: false, + FEATURE_SCHOOL_TERMS_OF_USE_ENABLED: false, }); expect(wrapper.find('[data-testid="terms-panel"]').exists()).toBe(false); @@ -145,7 +147,7 @@ describe("SchoolSettingsPage", () => { describe("when feature admin migration is disabled", () => { it("should not render admin migration expansion panel", () => { const { wrapper } = setup({ - getFeatureSchoolSanisUserMigrationEnabled: false, + FEATURE_USER_LOGIN_MIGRATION_ENABLED: false, }); expect(wrapper.find('[data-testid="migration-panel"]').exists()).toBe( diff --git a/src/pages/administration/SchoolSettings.page.vue b/src/pages/administration/SchoolSettings.page.vue index 10792be838..ac514f94da 100644 --- a/src/pages/administration/SchoolSettings.page.vue +++ b/src/pages/administration/SchoolSettings.page.vue @@ -153,7 +153,6 @@