From 2fea27dc94dc88cd8a33b29993aa34e7a61b9a7e Mon Sep 17 00:00:00 2001
From: Sebastian Mueller
Date: Mon, 18 Aug 2025 14:59:52 +0200
Subject: [PATCH 01/13] add focus trap to board layout dialog
---
.../SelectBoardLayoutDialog.unit.ts | 3 +-
.../room-details/SelectBoardLayoutDialog.vue | 61 ++++++++++---------
2 files changed, 34 insertions(+), 30 deletions(-)
diff --git a/src/modules/ui/room-details/SelectBoardLayoutDialog.unit.ts b/src/modules/ui/room-details/SelectBoardLayoutDialog.unit.ts
index f92ff9a868..2104ac2d8f 100644
--- a/src/modules/ui/room-details/SelectBoardLayoutDialog.unit.ts
+++ b/src/modules/ui/room-details/SelectBoardLayoutDialog.unit.ts
@@ -11,6 +11,8 @@ describe("@ui-room-details/SelectBoardLayoutDialog", () => {
const wrapper = mount(SelectBoardLayoutDialog, {
global: {
plugins: [createTestingVuetify(), createTestingI18n()],
+ stubs: { UseFocusTrap: true }, // unfortuantely it is not as straightward to test the focus trap
+ renderStubDefaultSlot: true,
},
props: {
modelValue: true,
@@ -23,7 +25,6 @@ describe("@ui-room-details/SelectBoardLayoutDialog", () => {
it("should be rendered correctly", async () => {
const { wrapper } = setup();
-
expect(wrapper.exists()).toBe(true);
});
diff --git a/src/modules/ui/room-details/SelectBoardLayoutDialog.vue b/src/modules/ui/room-details/SelectBoardLayoutDialog.vue
index 848b7d200a..bf557a8eb3 100644
--- a/src/modules/ui/room-details/SelectBoardLayoutDialog.vue
+++ b/src/modules/ui/room-details/SelectBoardLayoutDialog.vue
@@ -1,35 +1,37 @@
-
-
- {{ $t("pages.room.dialog.boardLayout.title") }}
-
-
-
-
-
-
+
+
- {{ $t("common.labels.close") }}
-
-
-
+ {{ $t("pages.room.dialog.boardLayout.title") }}
+
+
+
+
+
+
+ {{ $t("common.labels.close") }}
+
+
+
+
@@ -40,6 +42,7 @@ import { ExtendedIconBtn } from "@ui-extended-icon-btn";
import { PropType } from "vue";
import { useI18n } from "vue-i18n";
import { PickerOption } from "./types";
+import { UseFocusTrap } from "@vueuse/integrations/useFocusTrap/component";
const isOpen = defineModel({
type: Boolean,
From c59c520b8f648ef42f41bb9b81bcfb173c01690f Mon Sep 17 00:00:00 2001
From: Sebastian Mueller
Date: Tue, 19 Aug 2025 13:36:59 +0200
Subject: [PATCH 02/13] replace legacy usage of $t with t for i18n
---
src/modules/ui/room-details/SelectBoardLayoutDialog.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules/ui/room-details/SelectBoardLayoutDialog.vue b/src/modules/ui/room-details/SelectBoardLayoutDialog.vue
index bf557a8eb3..56373764cd 100644
--- a/src/modules/ui/room-details/SelectBoardLayoutDialog.vue
+++ b/src/modules/ui/room-details/SelectBoardLayoutDialog.vue
@@ -6,7 +6,7 @@
class="text-h4 text-break px-6 pt-4"
data-testid="board-layout-dialog-title"
>
- {{ $t("pages.room.dialog.boardLayout.title") }}
+ {{ t("pages.room.dialog.boardLayout.title") }}
- {{ $t("common.labels.close") }}
+ {{ t("common.labels.close") }}
From 922c82b24edc50d6065941badc51816d69ebbf8a Mon Sep 17 00:00:00 2001
From: Sebastian Mueller
Date: Tue, 19 Aug 2025 13:39:00 +0200
Subject: [PATCH 03/13] fix keyboard handling in Roop Copy Info Dialog
---
src/modules/feature/room/RoomCopyFlow.vue | 11 +-
.../feature/room/RoomCopyInfoDialog.vue | 109 +++++++++---------
2 files changed, 64 insertions(+), 56 deletions(-)
diff --git a/src/modules/feature/room/RoomCopyFlow.vue b/src/modules/feature/room/RoomCopyFlow.vue
index f244c96a4a..1b869b2b09 100644
--- a/src/modules/feature/room/RoomCopyFlow.vue
+++ b/src/modules/feature/room/RoomCopyFlow.vue
@@ -3,6 +3,7 @@
v-if="isRoomCopyInfoDialogOpen"
@copy:cancel="onCancelCopy"
@copy:confirm="onConfirmCopy"
+ @copy:close="onClose"
/>
@@ -42,14 +43,18 @@ onMounted(() => {
isLoadingDialogOpen.value = false;
});
-const onCancelCopy = () => {
+const onClose = () => {
isRoomCopyInfoDialogOpen.value = false;
- emit("copy:cancel");
emit("copy:ended");
};
+const onCancelCopy = () => {
+ emit("copy:cancel");
+ onClose();
+};
+
const onConfirmCopy = async () => {
- isRoomCopyInfoDialogOpen.value = false;
+ onClose();
isLoadingDialogOpen.value = true;
try {
diff --git a/src/modules/feature/room/RoomCopyInfoDialog.vue b/src/modules/feature/room/RoomCopyInfoDialog.vue
index e626584cc1..28ba5f8727 100644
--- a/src/modules/feature/room/RoomCopyInfoDialog.vue
+++ b/src/modules/feature/room/RoomCopyInfoDialog.vue
@@ -1,64 +1,67 @@
-
+
-
- {{ $t("feature-room.CopyInfoDialog.title") }}
-
-
-
- {{ $t("feature-room.CopyInfoDialog.text.nextStep") }}
-
-
-
- {{ t("feature-room.CopyInfoDialog.text.alert.followingContent") }}
-
-
- -
- {{
- t("feature-room.CopyInfoDialog.text.alert.membersPermissions")
- }}
-
- -
- {{ t("feature-room.CopyInfoDialog.text.alert.Etherpad") }}
-
- -
- {{ t("feature-room.CopyInfoDialog.text.alert.whiteboard") }}
-
- -
- {{
- t("feature-room.CopyInfoDialog.text.alert.protectedSettings")
- }}
-
-
-
-
-
-
-
- {{ $t("common.actions.cancel") }}
-
-
+
- {{ $t("common.actions.duplicate") }}
-
-
+ {{ t("feature-room.CopyInfoDialog.title") }}
+
+
+
+ {{ t("feature-room.CopyInfoDialog.text.nextStep") }}
+
+
+
+ {{ t("feature-room.CopyInfoDialog.text.alert.followingContent") }}
+
+
+ -
+ {{
+ t("feature-room.CopyInfoDialog.text.alert.membersPermissions")
+ }}
+
+ -
+ {{ t("feature-room.CopyInfoDialog.text.alert.Etherpad") }}
+
+ -
+ {{ t("feature-room.CopyInfoDialog.text.alert.whiteboard") }}
+
+ -
+ {{
+ t("feature-room.CopyInfoDialog.text.alert.protectedSettings")
+ }}
+
+
+
+
+
+
+
+ {{ t("common.actions.cancel") }}
+
+
+ {{ $t("common.actions.duplicate") }}
+
+
+
From 09c30ec7e0a559f98dbfbbf59fe89affffb01099 Mon Sep 17 00:00:00 2001
From: Sebastian Mueller
Date: Tue, 19 Aug 2025 15:03:25 +0200
Subject: [PATCH 04/13] use v-for for list items
---
.../feature/room/RoomCopyInfoDialog.vue | 26 +++++++------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/src/modules/feature/room/RoomCopyInfoDialog.vue b/src/modules/feature/room/RoomCopyInfoDialog.vue
index 28ba5f8727..4b1a999a71 100644
--- a/src/modules/feature/room/RoomCopyInfoDialog.vue
+++ b/src/modules/feature/room/RoomCopyInfoDialog.vue
@@ -17,21 +17,8 @@
{{ t("feature-room.CopyInfoDialog.text.alert.followingContent") }}
- -
- {{
- t("feature-room.CopyInfoDialog.text.alert.membersPermissions")
- }}
-
- -
- {{ t("feature-room.CopyInfoDialog.text.alert.Etherpad") }}
-
- -
- {{ t("feature-room.CopyInfoDialog.text.alert.whiteboard") }}
-
- -
- {{
- t("feature-room.CopyInfoDialog.text.alert.protectedSettings")
- }}
+
-
+ {{ bulletPoint }}
@@ -51,7 +38,7 @@
data-testid="copy-info-dialog-confirm"
@click="$emit('copy:confirm')"
>
- {{ $t("common.actions.duplicate") }}
+ {{ t("common.actions.duplicate") }}
@@ -69,5 +56,12 @@ const { t } = useI18n();
const isOpen = ref(true);
+const infoListItems = [
+ "feature-room.CopyInfoDialog.text.alert.membersPermissions",
+ "feature-room.CopyInfoDialog.text.alert.Etherpad",
+ "feature-room.CopyInfoDialog.text.alert.whiteboard",
+ "feature-room.CopyInfoDialog.text.alert.protectedSettings",
+].map(t);
+
defineEmits(["copy:cancel", "copy:confirm", "copy:close"]);
From f849f592ff0ebb49ef3426f4c7db585cb3e90d92 Mon Sep 17 00:00:00 2001
From: Sebastian Mueller
Date: Tue, 19 Aug 2025 17:04:32 +0200
Subject: [PATCH 05/13] WIP: refactor ShareModal
---
src/components/organisms/vCustomDialog.vue | 12 +-
src/components/share/ShareModal.vue | 191 +++++++-----------
.../feature/room/RoomCopyInfoDialog.vue | 2 +-
3 files changed, 80 insertions(+), 125 deletions(-)
diff --git a/src/components/organisms/vCustomDialog.vue b/src/components/organisms/vCustomDialog.vue
index 2af86be4b1..58ed5c85e1 100644
--- a/src/components/organisms/vCustomDialog.vue
+++ b/src/components/organisms/vCustomDialog.vue
@@ -83,6 +83,14 @@
diff --git a/src/modules/feature/room/RoomCopyInfoDialog.vue b/src/modules/feature/room/RoomCopyInfoDialog.vue
index 4b1a999a71..b3b05792ab 100644
--- a/src/modules/feature/room/RoomCopyInfoDialog.vue
+++ b/src/modules/feature/room/RoomCopyInfoDialog.vue
@@ -8,7 +8,7 @@
>
{{ t("feature-room.CopyInfoDialog.title") }}
-
+
{{ t("feature-room.CopyInfoDialog.text.nextStep") }}
From d5d1d8dd34b9aa6cc299f7dd6d6da5426db4c51b Mon Sep 17 00:00:00 2001
From: Sebastian Mueller
Date: Tue, 19 Aug 2025 18:15:02 +0200
Subject: [PATCH 06/13] WIP: remove Custom Dialog usage from Sahre Modal
---
src/components/share/ShareModal.vue | 158 ++++++++++++++--------------
1 file changed, 78 insertions(+), 80 deletions(-)
diff --git a/src/components/share/ShareModal.vue b/src/components/share/ShareModal.vue
index e8044108e2..3607853951 100644
--- a/src/components/share/ShareModal.vue
+++ b/src/components/share/ShareModal.vue
@@ -1,73 +1,86 @@
-
-
-
- {{ modalTitle }}
-
-
-
-
-
-
-
-
- {{ t(`components.molecules.share.${type}.options.infoText`) }}
-
-
-
-
-
-
- {{ t("components.molecules.share.options.tableHeader.InfoText") }}
-
- -
- {{ t(bulletPoint.translation) }}
-
-
+
+
+
+
+ {{ modalTitle }}
+
+
+
+
+ {{ t(`components.molecules.share.${type}.options.infoText`) }}
+
+
+
+
+
+
+ {{
+ t("components.molecules.share.options.tableHeader.InfoText")
+ }}
+
+ -
+ {{ t(bulletPoint.translation) }}
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ t("common.actions.cancel") }}
+
+
+ {{ t("common.actions.continue") }}
+
+
+
+
+ {{ t("common.labels.close") }}
+
+
+
+
+
+
+
diff --git a/src/modules/ui/room-details/SelectBoardLayoutDialog.vue b/src/modules/ui/room-details/SelectBoardLayoutDialog.vue
index 56373764cd..df5e1ff2e7 100644
--- a/src/modules/ui/room-details/SelectBoardLayoutDialog.vue
+++ b/src/modules/ui/room-details/SelectBoardLayoutDialog.vue
@@ -1,6 +1,6 @@
-
+
{
notifierModule.show({
text: t("pages.content.notification.lernstoreNotAvailable"),
status: "error",
- timeout: 5000,
});
}
}, 500);
@@ -230,7 +229,6 @@ const addContent = async () => {
notifierModule.show({
text: t("pages.content.notification.lernstoreNotAvailable"),
status: "error",
- timeout: 5000,
});
}
};
diff --git a/src/pages/NewsCreate.page.vue b/src/pages/NewsCreate.page.vue
index 8872467d89..e470122de6 100644
--- a/src/pages/NewsCreate.page.vue
+++ b/src/pages/NewsCreate.page.vue
@@ -65,7 +65,6 @@ export default {
notifierModule.show({
text: this.$t("components.organisms.FormNews.success.create"),
status: "success",
- timeout: 5000,
});
await this.$router.push({
path: `/news/${this.createdNews.id}`,
@@ -75,7 +74,6 @@ export default {
notifierModule.show({
text: this.$t("components.organisms.FormNews.errors.create"),
status: "error",
- timeout: 5000,
});
}
},
diff --git a/src/pages/NewsEdit.page.vue b/src/pages/NewsEdit.page.vue
index 9207e0dbf4..70a5e9ad29 100644
--- a/src/pages/NewsEdit.page.vue
+++ b/src/pages/NewsEdit.page.vue
@@ -118,7 +118,6 @@ const showNotifier = (type: AlertStatus, method: "remove" | "patch") => {
notifierModule.show({
text: t(`components.organisms.FormNews.${type}.${method}`),
status: type,
- timeout: 5000,
});
};
diff --git a/src/pages/administration/LDAPConfig.page.vue b/src/pages/administration/LDAPConfig.page.vue
index ac8802e540..94dc3ff38f 100644
--- a/src/pages/administration/LDAPConfig.page.vue
+++ b/src/pages/administration/LDAPConfig.page.vue
@@ -205,7 +205,6 @@ export default {
notifierModule.show({
text: this.$t("pages.administration.ldap.index.verified"),
status: "success",
- timeout: 5000,
});
if (systemId) {
this.$router.push({
diff --git a/src/pages/administration/StudentConsent.page.vue b/src/pages/administration/StudentConsent.page.vue
index 91a4b309f5..ed56d146d1 100644
--- a/src/pages/administration/StudentConsent.page.vue
+++ b/src/pages/administration/StudentConsent.page.vue
@@ -541,7 +541,6 @@ export default {
"pages.administration.students.consent.steps.register.success"
),
status: "success",
- timeout: 5000,
});
this.next();
}
@@ -602,7 +601,6 @@ export default {
notifierModule.show({
text: this.$t("pages.administration.students.consent.table.empty"),
status: "error",
- timeout: 5000,
});
this.$router.push({
diff --git a/src/pages/administration/StudentCreate.page.vue b/src/pages/administration/StudentCreate.page.vue
index da48b7bc99..1c088bffac 100644
--- a/src/pages/administration/StudentCreate.page.vue
+++ b/src/pages/administration/StudentCreate.page.vue
@@ -102,7 +102,6 @@ export default {
notifierModule.show({
text: this.$t("pages.administration.students.new.success"),
status: "success",
- timeout: 5000,
});
this.$router.push({
path: `/administration/students`,
diff --git a/src/pages/administration/StudentOverview.page.vue b/src/pages/administration/StudentOverview.page.vue
index 8c18072ec5..e73cfc95fe 100644
--- a/src/pages/administration/StudentOverview.page.vue
+++ b/src/pages/administration/StudentOverview.page.vue
@@ -565,20 +565,17 @@ export default {
rowIds.length
),
status: "success",
- timeout: 5000,
});
} else {
notifierModule.show({
text: this.$t("pages.administration.sendMail.alreadyRegistered"),
status: "info",
- timeout: 5000,
});
}
} catch {
notifierModule.show({
text: this.$t("pages.administration.sendMail.error", rowIds.length),
status: "error",
- timeout: 5000,
});
}
},
@@ -595,14 +592,12 @@ export default {
notifierModule.show({
text: this.$t("pages.administration.printQr.emptyUser"),
status: "info",
- timeout: 5000,
});
}
} catch {
notifierModule.show({
text: this.$t("pages.administration.printQr.error", rowIds.length),
status: "error",
- timeout: 5000,
});
}
},
@@ -616,14 +611,12 @@ export default {
notifierModule.show({
text: this.$t("pages.administration.remove.success"),
status: "success",
- timeout: 5000,
});
this.find();
} catch {
notifierModule.show({
text: this.$t("pages.administration.remove.error"),
status: "error",
- timeout: 5000,
});
}
};
diff --git a/src/pages/administration/TeacherCreate.page.vue b/src/pages/administration/TeacherCreate.page.vue
index 334a92691e..2450c52faf 100644
--- a/src/pages/administration/TeacherCreate.page.vue
+++ b/src/pages/administration/TeacherCreate.page.vue
@@ -79,7 +79,6 @@ export default {
notifierModule.show({
text: this.$t("pages.administration.teachers.new.success"),
status: "success",
- timeout: 5000,
});
this.$router.push({
path: `/administration/teachers`,
diff --git a/src/pages/administration/TeacherOverview.page.vue b/src/pages/administration/TeacherOverview.page.vue
index 0d49ac968a..a6a96d4eb3 100644
--- a/src/pages/administration/TeacherOverview.page.vue
+++ b/src/pages/administration/TeacherOverview.page.vue
@@ -517,13 +517,11 @@ export default {
notifierModule.show({
text: this.$t("pages.administration.sendMail.success", rowIds.length),
status: "success",
- timeout: 5000,
});
} catch {
notifierModule.show({
text: this.$t("pages.administration.sendMail.error", rowIds.length),
status: "error",
- timeout: 5000,
});
}
},
@@ -540,14 +538,12 @@ export default {
notifierModule.show({
text: this.$t("pages.administration.printQr.emptyUser"),
status: "info",
- timeout: 5000,
});
}
} catch {
notifierModule.show({
text: this.$t("pages.administration.printQr.error", rowIds.length),
status: "error",
- timeout: 5000,
});
}
},
@@ -561,14 +557,12 @@ export default {
notifierModule.show({
text: this.$t("pages.administration.remove.success"),
status: "success",
- timeout: 5000,
});
this.find();
} catch {
notifierModule.show({
text: this.$t("pages.administration.remove.error"),
status: "error",
- timeout: 5000,
});
}
};
diff --git a/src/pages/course-rooms/CourseRoomOverview.page.vue b/src/pages/course-rooms/CourseRoomOverview.page.vue
index 9d7379ad1b..792e9acbbe 100644
--- a/src/pages/course-rooms/CourseRoomOverview.page.vue
+++ b/src/pages/course-rooms/CourseRoomOverview.page.vue
@@ -404,7 +404,6 @@ export default defineComponent({
name,
}),
status: "success",
- timeout: 5000,
});
},
initCoursePolling(started, count = 0) {
@@ -419,7 +418,6 @@ export default defineComponent({
text: this.$t("components.molecules.copyResult.timeoutSuccess"),
status: "success",
autoClose: true,
- timeout: 5000,
});
}
},
diff --git a/src/pages/h5p/H5PEditor.page.vue b/src/pages/h5p/H5PEditor.page.vue
index 4a3c73ea2c..ea3cb07780 100644
--- a/src/pages/h5p/H5PEditor.page.vue
+++ b/src/pages/h5p/H5PEditor.page.vue
@@ -95,7 +95,6 @@ const save = async () => {
notifierModule.show({
text: t("pages.h5p.api.success.save"),
status: "success",
- timeout: 5000,
});
notifyParent(
@@ -111,7 +110,6 @@ const save = async () => {
notifierModule.show({
text: t("common.validation.invalid"),
status: "error",
- timeout: 5000,
});
}
}
From 8957ad37e2a543ab75a4bb96bb3b0bf6e17fe33f Mon Sep 17 00:00:00 2001
From: Sebastian Mueller
Date: Tue, 26 Aug 2025 14:20:12 +0200
Subject: [PATCH 11/13] wip: modify tests
---
src/components/share/ShareModal.unit.ts | 16 +++++++++++++++-
src/components/share/ShareModal.vue | 7 +++++--
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/components/share/ShareModal.unit.ts b/src/components/share/ShareModal.unit.ts
index 841f961a9b..8a71d529c9 100644
--- a/src/components/share/ShareModal.unit.ts
+++ b/src/components/share/ShareModal.unit.ts
@@ -81,7 +81,7 @@ describe("@/components/share/ShareModal", () => {
it("should call 'resetShareFlow' store method when dialog closed", () => {
const { wrapper } = setup();
- const dialog = wrapper.findComponent("share-modal-result");
+ const dialog = wrapper.findComponent(VDialog);
dialog.vm.$emit("after-leave");
@@ -120,7 +120,21 @@ describe("@/components/share/ShareModal", () => {
getParentType: ShareTokenBodyParamsParentTypeEnum.Courses,
getShareUrl: "http://example.com",
});
+ // need to mock the step two state on the dialog
const { wrapper } = setup();
+ /*
+ // const stepOneForm = wrapper.findComponent(ShareModalOptionsForm);
+ const dialog = wrapper.findComponent(VDialog);
+
+ const buttons = dialog.findAllComponents({ name: "v-btn", props: { variant: "flat" } });
+ expect(buttons.length).toBe(2);
+ expect(buttons[0].text()).toBe("common.actions.cancel");
+ expect(buttons[1].text()).toBe("common.actions.continue");
+
+ buttons[1].vm.$emit("click");
+ wrapper.vm.$nextTick();
+ // stepOneform.vm.$emit("share-options-change", payload);
+ */
const form = wrapper.findComponent(ShareModalResult);
form.vm.$emit("copied");
diff --git a/src/components/share/ShareModal.vue b/src/components/share/ShareModal.vue
index 65d2ca19e8..63b66ebcdb 100644
--- a/src/components/share/ShareModal.vue
+++ b/src/components/share/ShareModal.vue
@@ -39,7 +39,7 @@
@@ -116,7 +116,8 @@ const modalTitle = computed(() =>
);
const onShareOptionsChange = (newValue: ShareOptions) => {
- shareOptions.value = newValue;
+ shareOptions.value = { hasExpiryDate: newValue.hasExpiryDate, isSchoolInternal: newValue.isSchoolInternal };
+ console.log("now we should have the new value", newValue);
};
const onCloseDialogOrDone = () => {
shareModule.resetShareFlow();
@@ -127,6 +128,8 @@ const onCleanUp = () => {
};
const onNext = () => {
+ // shareModule.createShareUrl({ isSchoolInternal: false, hasExpiryDate: false });
+ // but why is there no value available here yet?
if (shareOptions.value) {
shareModule.createShareUrl(shareOptions.value);
step.value = "secondStep";
From ce78506f81c5510752bb0f1e53d503c09030d68f Mon Sep 17 00:00:00 2001
From: Sebastian Mueller
Date: Wed, 27 Aug 2025 18:56:46 +0200
Subject: [PATCH 12/13] fix ShareModal unit tests
---
src/components/share/ShareModal.unit.ts | 57 ++++++++++++++-----------
src/components/share/ShareModal.vue | 32 ++++++++------
2 files changed, 50 insertions(+), 39 deletions(-)
diff --git a/src/components/share/ShareModal.unit.ts b/src/components/share/ShareModal.unit.ts
index 8a71d529c9..7928c2f3a8 100644
--- a/src/components/share/ShareModal.unit.ts
+++ b/src/components/share/ShareModal.unit.ts
@@ -12,6 +12,7 @@ import {
import { mount } from "@vue/test-utils";
import ShareModal from "./ShareModal.vue";
import { VDialog } from "vuetify/components/VDialog";
+import { nextTick } from "vue";
describe("@/components/share/ShareModal", () => {
let shareModuleMock: ShareModule;
@@ -60,16 +61,17 @@ describe("@/components/share/ShareModal", () => {
const { wrapper } = setup();
const title = wrapper.findComponent({ name: "v-card-title" });
- expect(title.text()).toContain(
- "components.molecules.share.options.title"
- );
+ expect(title.text()).toContain("components.molecules.share.options.title");
});
it("should call 'createShareUrl' store method when next button clicked", () => {
const { wrapper } = setup();
const dialog = wrapper.findComponent(VDialog);
- const buttons = dialog.findAllComponents({ name: "v-btn", props: { variant: "flat" } });
+ const buttons = dialog.findAllComponents({
+ name: "v-btn",
+ props: { variant: "flat" },
+ });
expect(buttons.length).toBe(2);
expect(buttons[0].text()).toBe("common.actions.cancel");
expect(buttons[1].text()).toBe("common.actions.continue");
@@ -88,15 +90,34 @@ describe("@/components/share/ShareModal", () => {
expect(shareModuleMock.resetShareFlow).toHaveBeenCalled();
});
- it("should call 'resetShareFlow' store method when sub component emits 'done'", () => {
+ it("should return the component state to firstStep when dialog closes", () => {
+ const { wrapper } = setup();
+ const dialog = wrapper.findComponent(VDialog);
+
+ expect((wrapper.vm as unknown as typeof ShareModal).step).toBe("firstStep");
+
+ (wrapper.vm as unknown as typeof ShareModal).onNext();
+ expect((wrapper.vm as unknown as typeof ShareModal).step).toBe(
+ "secondStep"
+ );
+
+ dialog.vm.$emit("after-leave");
+ wrapper.vm.$nextTick();
+ expect((wrapper.vm as unknown as typeof ShareModal).step).toBe("firstStep");
+ });
+
+ it("should call 'resetShareFlow' store method when sub component emits 'done'", async () => {
shareModuleMock = createModuleMocks(ShareModule, {
getIsShareModalOpen: true,
getParentType: ShareTokenBodyParamsParentTypeEnum.Courses,
getShareUrl: "http://example.com",
});
const { wrapper } = setup();
- const form = wrapper.findComponent(ShareModalResult);
+ (wrapper.vm as unknown as typeof ShareModal).step = "secondStep";
+ await nextTick();
+
+ const form = wrapper.findComponent(ShareModalResult);
form.vm.$emit("done");
expect(shareModuleMock.resetShareFlow).toHaveBeenCalled();
@@ -114,27 +135,17 @@ describe("@/components/share/ShareModal", () => {
).toStrictEqual(payload);
});
- it("should call 'onCopy' method when sub component emits 'copied'", async () => {
+ it("should call 'onCopy' method when 'onNext' is called'", async () => {
shareModuleMock = createModuleMocks(ShareModule, {
getIsShareModalOpen: true,
getParentType: ShareTokenBodyParamsParentTypeEnum.Courses,
getShareUrl: "http://example.com",
});
- // need to mock the step two state on the dialog
const { wrapper } = setup();
- /*
- // const stepOneForm = wrapper.findComponent(ShareModalOptionsForm);
- const dialog = wrapper.findComponent(VDialog);
- const buttons = dialog.findAllComponents({ name: "v-btn", props: { variant: "flat" } });
- expect(buttons.length).toBe(2);
- expect(buttons[0].text()).toBe("common.actions.cancel");
- expect(buttons[1].text()).toBe("common.actions.continue");
+ (wrapper.vm as unknown as typeof ShareModal).onNext();
+ await wrapper.vm.$nextTick();
- buttons[1].vm.$emit("click");
- wrapper.vm.$nextTick();
- // stepOneform.vm.$emit("share-options-change", payload);
- */
const form = wrapper.findComponent(ShareModalResult);
form.vm.$emit("copied");
@@ -142,19 +153,15 @@ describe("@/components/share/ShareModal", () => {
});
describe("ctl tool info", () => {
- it("should have the correct title", () => {
+ it("should have the correct title", async () => {
const { wrapper } = setup();
- // const dialog = wrapper.findComponent(VDialog);
const cardText = wrapper.findComponent({ name: "v-card-text" });
-
- // woher kommst du denn?
const infotext = cardText.find(
`[data-testid="share-modal-external-tools-info"]`
);
- expect(infotext.isVisible()).toBe(true);
- expect(infotext.text()).toEqual(
+ expect(infotext.text()).toContain(
"components.molecules.shareImport.options.ctlTools.infoText.unavailable"
);
});
diff --git a/src/components/share/ShareModal.vue b/src/components/share/ShareModal.vue
index 63b66ebcdb..cff75d10c9 100644
--- a/src/components/share/ShareModal.vue
+++ b/src/components/share/ShareModal.vue
@@ -30,7 +30,7 @@
{{ t(bulletPoint.translation) }}
@@ -116,20 +116,24 @@ const modalTitle = computed(() =>
);
const onShareOptionsChange = (newValue: ShareOptions) => {
- shareOptions.value = { hasExpiryDate: newValue.hasExpiryDate, isSchoolInternal: newValue.isSchoolInternal };
- console.log("now we should have the new value", newValue);
+ shareOptions.value = {
+ hasExpiryDate: newValue.hasExpiryDate,
+ isSchoolInternal: newValue.isSchoolInternal,
+ };
};
+
const onCloseDialogOrDone = () => {
shareModule.resetShareFlow();
};
const onCleanUp = () => {
step.value = "firstStep";
+ shareModule.resetShareFlow();
};
const onNext = () => {
- // shareModule.createShareUrl({ isSchoolInternal: false, hasExpiryDate: false });
- // but why is there no value available here yet?
+ // shareModule.createShareUrl({ isSchoolInternal: false, hasExpiryDate: false });
+ // but why is there no value available here yet?
if (shareOptions.value) {
shareModule.createShareUrl(shareOptions.value);
step.value = "secondStep";
@@ -144,7 +148,7 @@ const onCopy = () => {
};
const showAlertInfo = computed(() =>
- ["course", "columnBoard", "lessons", "room"].includes(props.type)
+ ["courses", "columnBoard", "lessons", "room"].includes(props.type)
);
const listItems = computed(() => {
@@ -152,7 +156,7 @@ const listItems = computed(() => {
{
translation:
"components.molecules.shareImport.options.restrictions.infoText.personalData",
- type: ["course"],
+ type: ["courses"],
testId: "share-options-personal-data-text",
},
{
@@ -164,40 +168,40 @@ const listItems = computed(() => {
{
translation:
"components.molecules.shareImport.options.restrictions.infoText.geogebra",
- type: ["course", "lessons"],
+ type: ["courses", "lessons"],
},
{
translation:
"components.molecules.shareImport.options.restrictions.infoText.etherpad",
- type: ["course", "room", "columnBoard", "lessons"],
+ type: ["courses", "room", "columnBoard", "lessons"],
},
{
translation:
"components.molecules.shareImport.options.restrictions.infoText.whiteboard",
- type: ["course", "room", "columnBoard"],
+ type: ["courses", "room", "columnBoard"],
},
{
translation:
"components.molecules.shareImport.options.ctlTools.infoText.unavailable",
- type: ["course", "room", "columnBoard"],
+ type: ["courses", "room", "columnBoard"],
testId: "share-modal-external-tools-info",
},
{
translation:
"components.molecules.shareImport.options.ctlTools.infoText.protected",
- type: ["course", "room", "columnBoard"],
+ type: ["courses", "room", "columnBoard"],
testId: "share-modal-external-tools-protected-parameter-info",
},
{
translation:
"components.molecules.shareImport.options.restrictions.infoText.courseFiles",
- type: ["course"],
+ type: ["courses"],
testId: "share-modal-coursefiles-info",
},
{
translation:
"components.molecules.shareImport.options.restrictions.infoText.courseGroups",
- type: ["course"],
+ type: ["courses"],
},
].filter(({ type }) => type.includes(props.type));
});
From 39de9d2084c67a3ade10c11016fa0c854190ab8c Mon Sep 17 00:00:00 2001
From: Sebastian Mueller
Date: Wed, 27 Aug 2025 19:20:05 +0200
Subject: [PATCH 13/13] fix more tests
---
src/modules/feature/room/RoomCopyFlow.unit.ts | 1 +
src/modules/feature/room/RoomCopyFlow.vue | 4 ++--
.../room/roomMembers/dialogs/InviteMembersDialog.unit.ts | 1 -
src/pages/h5p/H5PEditor.page.unit.ts | 3 ---
4 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/modules/feature/room/RoomCopyFlow.unit.ts b/src/modules/feature/room/RoomCopyFlow.unit.ts
index 4ce1d25ae8..c7fd2da27f 100644
--- a/src/modules/feature/room/RoomCopyFlow.unit.ts
+++ b/src/modules/feature/room/RoomCopyFlow.unit.ts
@@ -56,6 +56,7 @@ describe("@feature-room/RoomCopyFlow", () => {
[NOTIFIER_MODULE_KEY.valueOf()]: notifierModuleMock,
["loadingStateModule"]: loadingStateModuleMock,
},
+ stubs: { UseFocusTrap: true },
},
props: {
room,
diff --git a/src/modules/feature/room/RoomCopyFlow.vue b/src/modules/feature/room/RoomCopyFlow.vue
index 1b869b2b09..dad7fa6c3c 100644
--- a/src/modules/feature/room/RoomCopyFlow.vue
+++ b/src/modules/feature/room/RoomCopyFlow.vue
@@ -45,12 +45,12 @@ onMounted(() => {
const onClose = () => {
isRoomCopyInfoDialogOpen.value = false;
- emit("copy:ended");
};
const onCancelCopy = () => {
- emit("copy:cancel");
onClose();
+ emit("copy:cancel");
+ emit("copy:ended");
};
const onConfirmCopy = async () => {
diff --git a/src/modules/feature/room/roomMembers/dialogs/InviteMembersDialog.unit.ts b/src/modules/feature/room/roomMembers/dialogs/InviteMembersDialog.unit.ts
index 60e3e35f7f..f660b86c7f 100644
--- a/src/modules/feature/room/roomMembers/dialogs/InviteMembersDialog.unit.ts
+++ b/src/modules/feature/room/roomMembers/dialogs/InviteMembersDialog.unit.ts
@@ -319,7 +319,6 @@ describe("InviteMembersDialog", () => {
expect(notifierModule.show).toHaveBeenCalledWith({
text: "common.words.copiedToClipboard",
status: "success",
- timeout: 5000,
});
});
});
diff --git a/src/pages/h5p/H5PEditor.page.unit.ts b/src/pages/h5p/H5PEditor.page.unit.ts
index 408fe9ef66..46be6ae29b 100644
--- a/src/pages/h5p/H5PEditor.page.unit.ts
+++ b/src/pages/h5p/H5PEditor.page.unit.ts
@@ -243,7 +243,6 @@ describe("H5PEditorPage", () => {
expect(notifierModule.show).toHaveBeenCalledWith({
text: "pages.h5p.api.success.save",
status: "success",
- timeout: 5000,
});
});
});
@@ -292,7 +291,6 @@ describe("H5PEditorPage", () => {
expect(notifierModule.show).toHaveBeenCalledWith({
text: "common.validation.invalid",
status: "error",
- timeout: 5000,
});
});
});
@@ -341,7 +339,6 @@ describe("H5PEditorPage", () => {
expect(notifierModule.show).toHaveBeenCalledWith({
text: "common.validation.invalid",
status: "error",
- timeout: 5000,
});
});
});