Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/administration/ProvisioningOptionsPage.unit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ProvisioningOptionsPage from "./ProvisioningOptionsPage.vue";
import VCustomDialog from "@/components/organisms/vCustomDialog.vue";
import CustomDialog from "@/components/organisms/CustomDialog.vue";
import { ConfigResponse } from "@/serverApi/v3";
import { THEME_KEY } from "@/utils/inject";
import { createTestEnvStore, provisioningOptionsDataFactory } from "@@/tests/test-utils";
Expand Down Expand Up @@ -296,7 +296,7 @@ describe("ProvisioningOptionsPage", () => {

await saveButton.trigger("click");

const dialog = wrapper.findComponent(VCustomDialog);
const dialog = wrapper.findComponent(CustomDialog);

expect(dialog.props("isOpen")).toEqual(true);
});
Expand Down
6 changes: 3 additions & 3 deletions src/components/administration/ProvisioningOptionsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</v-btn>
</v-row>

<v-custom-dialog
<CustomDialog
:is-open="isWarningDialogOpen"
:has-buttons="true"
:buttons="['cancel', 'confirm']"
Expand Down Expand Up @@ -118,13 +118,13 @@
}}
</v-alert>
</template>
</v-custom-dialog>
</CustomDialog>
</DefaultWireframe>
</template>

<script setup lang="ts">
import { Breadcrumb } from "../templates/default-wireframe.types";
import VCustomDialog from "@/components/organisms/vCustomDialog.vue";
import CustomDialog from "@/components/organisms/CustomDialog.vue";
import DefaultWireframe from "@/components/templates/DefaultWireframe.vue";
import { injectStrict, THEME_KEY } from "@/utils/inject";
import { buildPageTitle } from "@/utils/pageTitle";
Expand Down
10 changes: 5 additions & 5 deletions src/components/administration/SchoolYearChangeSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
{{ t("components.administration.schoolYearChangeSection.step.three.button") }}
</VBtn>
</div>
<VCustomDialog
<CustomDialog
v-model:is-open="isStartDialogOpen"
has-buttons
:buttons="['cancel', 'confirm']"
Expand All @@ -133,8 +133,8 @@
<template #content>
{{ t("components.administration.schoolYearChangeSection.dialog.start.content") }}
</template>
</VCustomDialog>
<VCustomDialog
</CustomDialog>
<CustomDialog
v-model:is-open="isFinishDialogOpen"
has-buttons
:buttons="['cancel', 'confirm']"
Expand All @@ -147,13 +147,13 @@
<template #content>
{{ t("components.administration.schoolYearChangeSection.dialog.finish.content") }}
</template>
</VCustomDialog>
</CustomDialog>
</div>
</div>
</template>

<script setup lang="ts">
import VCustomDialog from "@/components/organisms/vCustomDialog.vue";
import CustomDialog from "@/components/organisms/CustomDialog.vue";
import { useAppStoreRefs } from "@data-app";
import { useEnvConfig } from "@data-env";
import { SchoolYearModeEnum, useSharedSchoolYearChange } from "@data-school";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import VCustomChipTimeRemaining from "./VCustomChipTimeRemaining.vue";
import ChipTimeRemaining from "./ChipTimeRemaining.vue";
import { createTestingI18n, createTestingVuetify } from "@@/tests/test-utils/setup";
import { mount } from "@vue/test-utils";

describe("@/components/atoms/vCustomChipTimeRemaining", () => {
describe("@/components/atoms/ChipTimeRemaining", () => {
const setup = (dueDate: Date, shortenUnit = false) => {
const wrapper = mount(VCustomChipTimeRemaining, {
const wrapper = mount(ChipTimeRemaining, {
global: {
plugins: [createTestingVuetify(), createTestingI18n()],
},
Expand All @@ -31,8 +31,8 @@ describe("@/components/atoms/vCustomChipTimeRemaining", () => {
const { wrapper } = setup(dueDate);

const expectedResult = `${wrapper.vm.$t(
"components.atoms.VCustomChipTimeRemaining.hintDueTime"
)}${HOURS_UNTIL_DUE} ${wrapper.vm.$t("components.atoms.VCustomChipTimeRemaining.hintHours", HOURS_UNTIL_DUE)}`;
"components.atoms.ChipTimeRemaining.hintDueTime"
)}${HOURS_UNTIL_DUE} ${wrapper.vm.$t("components.atoms.ChipTimeRemaining.hintHours", HOURS_UNTIL_DUE)}`;

expect(wrapper.element.textContent).toContain(expectedResult);
});
Expand All @@ -41,8 +41,8 @@ describe("@/components/atoms/vCustomChipTimeRemaining", () => {
const { wrapper } = setup(dueDate, true);

const expectedResult = `${wrapper.vm.$t(
"components.atoms.VCustomChipTimeRemaining.hintDueTime"
)}${HOURS_UNTIL_DUE} ${wrapper.vm.$t("components.atoms.VCustomChipTimeRemaining.hintHoursShort")}`;
"components.atoms.ChipTimeRemaining.hintDueTime"
)}${HOURS_UNTIL_DUE} ${wrapper.vm.$t("components.atoms.ChipTimeRemaining.hintHoursShort")}`;
expect(wrapper.element.textContent).toContain(expectedResult);
});
});
Expand All @@ -60,11 +60,8 @@ describe("@/components/atoms/vCustomChipTimeRemaining", () => {
const { wrapper } = setup(dueDate);

const expectedResult = `${wrapper.vm.$t(
"components.atoms.VCustomChipTimeRemaining.hintDueTime"
)}${MINUTES_UNTIL_DUE} ${wrapper.vm.$t(
"components.atoms.VCustomChipTimeRemaining.hintMinutes",
MINUTES_UNTIL_DUE
)}`;
"components.atoms.ChipTimeRemaining.hintDueTime"
)}${MINUTES_UNTIL_DUE} ${wrapper.vm.$t("components.atoms.ChipTimeRemaining.hintMinutes", MINUTES_UNTIL_DUE)}`;

expect(wrapper.element.textContent).toContain(expectedResult);
});
Expand All @@ -73,16 +70,16 @@ describe("@/components/atoms/vCustomChipTimeRemaining", () => {
const { wrapper } = setup(dueDate, true);

const expectedResult = `${wrapper.vm.$t(
"components.atoms.VCustomChipTimeRemaining.hintDueTime"
)}${MINUTES_UNTIL_DUE} ${wrapper.vm.$t("components.atoms.VCustomChipTimeRemaining.hintMinShort")}`;
"components.atoms.ChipTimeRemaining.hintDueTime"
)}${MINUTES_UNTIL_DUE} ${wrapper.vm.$t("components.atoms.ChipTimeRemaining.hintMinShort")}`;

expect(wrapper.element.textContent).toContain(expectedResult);
});
});

it("accepts valid type props", () => {
const validTypes = ["warning"];
const { validator } = VCustomChipTimeRemaining.props.type;
const { validator } = ChipTimeRemaining.props.type;

validTypes.forEach((type) => {
expect(validator(type)).toBe(true);
Expand All @@ -93,7 +90,7 @@ describe("@/components/atoms/vCustomChipTimeRemaining", () => {

it("accepts valid dueDate props", () => {
const validDueDates = ["2021-06-11T14:00:00.000Z", "2021-06-07T09:30:00.000Z"];
const { validator } = VCustomChipTimeRemaining.props.dueDate;
const { validator } = ChipTimeRemaining.props.dueDate;

validDueDates.forEach((dueDate) => {
expect(validator(dueDate)).toBe(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ const hintDueDate = (dueDate: string, shorten = false) => {
const diffMins = fromNowToFuture(dueDate, "minutes");

const label = shorten
? t("components.atoms.VCustomChipTimeRemaining.hintMinShort")
: t("components.atoms.VCustomChipTimeRemaining.hintMinutes", diffMins);
? t("components.atoms.ChipTimeRemaining.hintMinShort")
: t("components.atoms.ChipTimeRemaining.hintMinutes", diffMins);

return `${t("components.atoms.VCustomChipTimeRemaining.hintDueTime")}${diffMins} ${label}`;
return `${t("components.atoms.ChipTimeRemaining.hintDueTime")}${diffMins} ${label}`;
} else {
const label = shorten
? t("components.atoms.VCustomChipTimeRemaining.hintHoursShort")
: t("components.atoms.VCustomChipTimeRemaining.hintHours", diffHrs);
return `${t("components.atoms.VCustomChipTimeRemaining.hintDueTime")}${diffHrs} ${label}`;
? t("components.atoms.ChipTimeRemaining.hintHoursShort")
: t("components.atoms.ChipTimeRemaining.hintHours", diffHrs);
return `${t("components.atoms.ChipTimeRemaining.hintDueTime")}${diffHrs} ${label}`;
}
};
</script>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import vRoomAvatar from "./vRoomAvatar.vue";
import RoomAvatar from "./RoomAvatar.vue";
import { createTestingI18n, createTestingVuetify } from "@@/tests/test-utils/setup";
import { createMock } from "@golevelup/ts-vitest";
import { mdiSync } from "@icons/material";
Expand All @@ -22,9 +22,9 @@ const mockData = {

vi.mock("vue-router");

describe("vRoomAvatar", () => {
describe("RoomAvatar", () => {
const setup = (optionalProps: object = {}) => {
const wrapper = mount(vRoomAvatar, {
const wrapper = mount(RoomAvatar, {
global: {
plugins: [createTestingVuetify(), createTestingI18n()],
},
Expand Down Expand Up @@ -172,7 +172,7 @@ describe("vRoomAvatar", () => {
await avatarComponent.trigger("dragstart");
const startDragEvent = wrapper.emitted("startDrag");

expect((wrapper.vm as unknown as typeof vRoomAvatar).isDragging).toBe(true);
expect((wrapper.vm as unknown as typeof RoomAvatar).isDragging).toBe(true);
expect(startDragEvent).toHaveLength(1);
expect(startDragEvent && startDragEvent[0][0]).toStrictEqual(mockData);
});
Expand Down Expand Up @@ -202,7 +202,7 @@ describe("vRoomAvatar", () => {

await avatarComponent.trigger("dragenter");

expect((wrapper.vm as unknown as typeof vRoomAvatar).isDragging).toBe(false);
expect((wrapper.vm as unknown as typeof RoomAvatar).isDragging).toBe(false);
});

it("should emit 'dragend' event when draging ended", async () => {
Expand All @@ -211,7 +211,7 @@ describe("vRoomAvatar", () => {

await avatarComponent.trigger("dragend");

expect((wrapper.vm as unknown as typeof vRoomAvatar).isDragging).toBe(false);
expect((wrapper.vm as unknown as typeof RoomAvatar).isDragging).toBe(false);
expect(wrapper.emitted()).toHaveProperty("dragend");
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import vRoomEmptyAvatar from "./vRoomEmptyAvatar.vue";
import RoomEmptyAvatar from "./RoomEmptyAvatar.vue";
import { createTestingI18n, createTestingVuetify } from "@@/tests/test-utils/setup";
import { mount } from "@vue/test-utils";
import { nextTick } from "vue";

describe("vRoomEmptyAvatar", () => {
describe("RoomEmptyAvatar", () => {
const setup = () => {
const wrapper = mount(vRoomEmptyAvatar, {
const wrapper = mount(RoomEmptyAvatar, {
global: {
plugins: [createTestingVuetify(), createTestingI18n()],
},
Expand Down
42 changes: 0 additions & 42 deletions src/components/atoms/vRoomDeleteAvatar.unit.ts

This file was deleted.

55 changes: 0 additions & 55 deletions src/components/atoms/vRoomDeleteAvatar.vue

This file was deleted.

Loading
Loading