From 7cc36b060614414abe94d10687eb181b141ec714 Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Tue, 26 Nov 2024 01:59:13 +0100 Subject: [PATCH] import modal, test and locales --- src/components/share/ImportModal.unit.ts | 13 ++++--------- src/components/share/ImportModal.vue | 24 ++++++++++++++---------- src/components/share/ShareModal.unit.ts | 2 +- src/locales/de.ts | 18 +++++++++++++----- src/locales/en.ts | 18 +++++++++++++----- src/locales/es.ts | 18 +++++++++++++----- src/locales/uk.ts | 18 +++++++++++++----- 7 files changed, 71 insertions(+), 40 deletions(-) diff --git a/src/components/share/ImportModal.unit.ts b/src/components/share/ImportModal.unit.ts index 0d7ecc6ef3..c982d94ed4 100644 --- a/src/components/share/ImportModal.unit.ts +++ b/src/components/share/ImportModal.unit.ts @@ -2,11 +2,11 @@ import ImportModal from "@/components/share/ImportModal.vue"; import EnvConfigModule from "@/store/env-config"; import { ENV_CONFIG_MODULE_KEY } from "@/utils/inject"; import { createModuleMocks } from "@@/tests/test-utils/mock-store-module"; -import { mount } from "@vue/test-utils"; import { createTestingI18n, createTestingVuetify, } from "@@/tests/test-utils/setup"; +import { mount } from "@vue/test-utils"; describe("@components/share/ImportModal", () => { const setup = (envConfigModuleGetter?: Partial) => { @@ -123,7 +123,7 @@ describe("@components/share/ImportModal", () => { ); expect(infoText.attributes("html")).toEqual( - "components.molecules.import.courses.options.ctlTools.infoText" + "components.molecules.import.options.ctlTools.infoText" ); }); it("should not show course file info", () => { @@ -168,14 +168,9 @@ describe("@components/share/ImportModal", () => { it("should set the right key for course files", () => { const { wrapper } = setup({ getCtlToolsTabEnabled: false }); - const dialog = wrapper.findComponent({ name: "v-custom-dialog" }); - const cardText = dialog.findComponent({ name: "v-card-text" }); - - const infoText = cardText.find( - `[data-testid="import-modal-coursefiles-info"]` - ); + const renderHtml = wrapper.findComponent({ name: "RenderHTML" }); - expect(infoText.element.innerHTML).toEqual( + expect(renderHtml.props("html")).toEqual( "components.molecules.import.courses.options.infoText" ); }); diff --git a/src/components/share/ImportModal.vue b/src/components/share/ImportModal.vue index 085807f37c..c93dd3ca3a 100644 --- a/src/components/share/ImportModal.vue +++ b/src/components/share/ImportModal.vue @@ -23,18 +23,22 @@ -
- {{ + +
+
+ {{ t(`components.molecules.import.${parentType}.rename`) }}