Skip to content

Commit

Permalink
adjust test
Browse files Browse the repository at this point in the history
  • Loading branch information
MBergCap committed Oct 12, 2023
1 parent 5787134 commit 89b08aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/administration/ClassOverview.page.unit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import GroupModule from "@/store/group";
import { createModuleMocks } from "@/utils/mock-store-module";
import { classInfoResponseFactory, i18nMock } from "@@/tests/test-utils";
import { classInfoFactory, i18nMock } from "@@/tests/test-utils";
import { MountOptions, Wrapper, mount } from "@vue/test-utils";
import ClassOverview from "./ClassOverview.page.vue";
import { GROUP_MODULE_KEY, I18N_KEY } from "@/utils/inject";
Expand All @@ -14,7 +14,7 @@ describe("ClassOverview", () => {
document.body.setAttribute("data-app", "true");

const groupModule = createModuleMocks(GroupModule, {
getClasses: [classInfoResponseFactory.build()],
getClasses: [classInfoFactory.build()],
getPagination: {
limit: 10,
skip: 0,
Expand Down
10 changes: 10 additions & 0 deletions tests/test-utils/factory/classInfoFactory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Factory } from "fishery";
import { ClassInfo, ClassRootType } from "@/store/types/class-info";

export const classInfoFactory = Factory.define<ClassInfo>(({ sequence }) => ({
name: `className${sequence}`,
externalSourceName: "Source",
teachers: ["TestTeacher"],
type: ClassRootType.Class,
id: `id-${sequence}`,
}));
1 change: 1 addition & 0 deletions tests/test-utils/factory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export * from "./businessErrorFactory";
export * from "./cardSkeletonResponseFactory";
export * from "./classInfoSearchListResponseFactory";
export * from "./classInfoResponseFactory";
export * from "./classInfoFactory";
export * from "./columnResponseFactory";
export * from "./contextExternalToolConfigurationTemplate.factory";
export * from "./contextExternalToolConfigurationTemplateResponseFactory";
Expand Down

0 comments on commit 89b08aa

Please sign in to comment.