diff --git a/apps/server/src/infra/calendar/service/calendar.service.spec.ts b/apps/server/src/infra/calendar/service/calendar.service.spec.ts index bfbf5e0396b..42d4c3c4e53 100644 --- a/apps/server/src/infra/calendar/service/calendar.service.spec.ts +++ b/apps/server/src/infra/calendar/service/calendar.service.spec.ts @@ -4,7 +4,7 @@ import { CalendarEventDto, CalendarService } from '@infra/calendar'; import { HttpService } from '@nestjs/axios'; import { HttpStatus, InternalServerErrorException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { AxiosResponse } from 'axios'; import { of, throwError } from 'rxjs'; import { Logger } from '@src/core/logger'; diff --git a/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.client.spec.ts b/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.client.spec.ts index 225ddac258d..a25eb7f6a96 100644 --- a/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.client.spec.ts +++ b/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.client.spec.ts @@ -3,7 +3,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { HttpService } from '@nestjs/axios'; import { NotFoundException, NotImplementedException, UnprocessableEntityException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { AxiosResponse } from 'axios'; import { Observable, of } from 'rxjs'; diff --git a/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.strategy.spec.ts b/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.strategy.spec.ts index ec68c9a3968..029b00154cf 100644 --- a/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.strategy.spec.ts +++ b/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.strategy.spec.ts @@ -10,7 +10,7 @@ import { LtiToolDO } from '@shared/domain/domainobject/ltitool.do'; import { LtiPrivacyPermission, LtiRoleType, User } from '@shared/domain/entity'; import { RoleName } from '@shared/domain/interface'; import { LtiToolRepo } from '@shared/repo'; -import { ltiToolDOFactory, pseudonymFactory, setupEntities, userDoFactory, userFactory } from '@shared/testing'; +import { ltiToolDOFactory, pseudonymFactory, setupEntities, userDoFactory, userFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { TeamRolePermissionsDto } from '../../dto/team-role-permissions.dto'; import { NextcloudClient } from './nextcloud.client'; diff --git a/apps/server/src/infra/identity-management/keycloak-configuration/service/keycloak-configuration.service.spec.ts b/apps/server/src/infra/identity-management/keycloak-configuration/service/keycloak-configuration.service.spec.ts index 11bf59c9d8c..3e360a37f6b 100644 --- a/apps/server/src/infra/identity-management/keycloak-configuration/service/keycloak-configuration.service.spec.ts +++ b/apps/server/src/infra/identity-management/keycloak-configuration/service/keycloak-configuration.service.spec.ts @@ -15,7 +15,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { SystemEntity } from '@shared/domain/entity'; import { SystemTypeEnum } from '@shared/domain/types'; -import { systemEntityFactory } from '@shared/testing'; +import { systemEntityFactory } from '@shared/testing/factory'; import { AxiosResponse } from 'axios'; import { of } from 'rxjs'; import { v1 } from 'uuid'; diff --git a/apps/server/src/infra/oauth-provider/hydra/hydra.adapter.spec.ts b/apps/server/src/infra/oauth-provider/hydra/hydra.adapter.spec.ts index 2a373195bc6..5d09e4b6924 100644 --- a/apps/server/src/infra/oauth-provider/hydra/hydra.adapter.spec.ts +++ b/apps/server/src/infra/oauth-provider/hydra/hydra.adapter.spec.ts @@ -12,8 +12,7 @@ import { } from '@infra/oauth-provider/dto'; import { HttpService } from '@nestjs/axios'; import { Test, TestingModule } from '@nestjs/testing'; -import { axiosResponseFactory } from '@shared/testing'; -import { axiosErrorFactory } from '@shared/testing/factory'; +import { axiosResponseFactory, axiosErrorFactory } from '@shared/testing/factory'; import { AxiosError, AxiosRequestConfig, Method, RawAxiosRequestHeaders } from 'axios'; import { of, throwError } from 'rxjs'; import { ProviderConsentSessionResponse } from '../dto'; diff --git a/apps/server/src/infra/schulconnex-client/schulconnex-rest-client.spec.ts b/apps/server/src/infra/schulconnex-client/schulconnex-rest-client.spec.ts index 5a14e88b03c..0b2611098a1 100644 --- a/apps/server/src/infra/schulconnex-client/schulconnex-rest-client.spec.ts +++ b/apps/server/src/infra/schulconnex-client/schulconnex-rest-client.spec.ts @@ -1,7 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { OauthAdapterService, OAuthTokenDto } from '@modules/oauth'; import { HttpService } from '@nestjs/axios'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { of } from 'rxjs'; import { SchulconnexConfigurationMissingLoggable } from './loggable'; diff --git a/apps/server/src/modules/account/api/account.uc.spec.ts b/apps/server/src/modules/account/api/account.uc.spec.ts index 59394b03421..998402972ad 100644 --- a/apps/server/src/modules/account/api/account.uc.spec.ts +++ b/apps/server/src/modules/account/api/account.uc.spec.ts @@ -10,7 +10,7 @@ import { UnauthorizedException } from '@nestjs/common/exceptions/unauthorized.ex import { Role, User } from '@shared/domain/entity'; import { Permission, RoleName } from '@shared/domain/interface'; import { EntityId } from '@shared/domain/types'; -import { schoolEntityFactory, setupEntities, userFactory } from '@shared/testing'; +import { schoolEntityFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { Account, AccountSave } from '../domain'; import { AccountEntity } from '../domain/entity/account.entity'; import { AccountService } from '../domain/services'; diff --git a/apps/server/src/modules/account/api/test/account.api.spec.ts b/apps/server/src/modules/account/api/test/account.api.spec.ts index e5ee1b94c2d..f51275588a9 100644 --- a/apps/server/src/modules/account/api/test/account.api.spec.ts +++ b/apps/server/src/modules/account/api/test/account.api.spec.ts @@ -3,7 +3,13 @@ import { INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { User } from '@shared/domain/entity'; import { Permission, RoleName } from '@shared/domain/interface'; -import { TestApiClient, cleanupCollections, roleFactory, schoolEntityFactory, userFactory } from '@shared/testing'; +import { + TestApiClient, + cleanupCollections, + roleFactory, + schoolEntityFactory, + userFactory, +} from '@shared/testing/factory'; import { ServerTestModule } from '@modules/server/server.module'; import { AccountByIdBodyParams, diff --git a/apps/server/src/modules/account/domain/services/account-db.service.spec.ts b/apps/server/src/modules/account/domain/services/account-db.service.spec.ts index e39962db20b..17d51d80127 100644 --- a/apps/server/src/modules/account/domain/services/account-db.service.spec.ts +++ b/apps/server/src/modules/account/domain/services/account-db.service.spec.ts @@ -6,7 +6,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { EntityNotFoundError } from '@shared/common'; import { IdmAccount } from '@shared/domain/interface'; import { EntityId } from '@shared/domain/types'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import bcrypt from 'bcryptjs'; import { v1 } from 'uuid'; diff --git a/apps/server/src/modules/account/domain/services/account.service.spec.ts b/apps/server/src/modules/account/domain/services/account.service.spec.ts index 16991797d74..cd129f42e7e 100644 --- a/apps/server/src/modules/account/domain/services/account.service.spec.ts +++ b/apps/server/src/modules/account/domain/services/account.service.spec.ts @@ -14,7 +14,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { AuthorizationError, EntityNotFoundError, ForbiddenOperationError, ValidationError } from '@shared/common'; import { User } from '@shared/domain/entity'; import { UserRepo } from '@shared/repo'; -import { schoolEntityFactory, setupEntities, systemFactory, userFactory } from '@shared/testing'; +import { schoolEntityFactory, setupEntities, systemFactory, userFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import 'reflect-metadata'; import { Account, AccountSave, UpdateAccount } from '..'; diff --git a/apps/server/src/modules/account/domain/services/account.validation.service.spec.ts b/apps/server/src/modules/account/domain/services/account.validation.service.spec.ts index d376b8c81e3..47971568feb 100644 --- a/apps/server/src/modules/account/domain/services/account.validation.service.spec.ts +++ b/apps/server/src/modules/account/domain/services/account.validation.service.spec.ts @@ -3,7 +3,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Role } from '@shared/domain/entity'; import { Permission, RoleName } from '@shared/domain/interface'; import { UserRepo } from '@shared/repo'; -import { setupEntities, systemFactory, userFactory } from '@shared/testing'; +import { setupEntities, systemFactory, userFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { AccountRepo } from '../../repo/micro-orm/account.repo'; import { AccountValidationService } from './account.validation.service'; diff --git a/apps/server/src/modules/account/repo/micro-orm/account.repo.integration.spec.ts b/apps/server/src/modules/account/repo/micro-orm/account.repo.integration.spec.ts index c6fc186c726..2b1a4e52e51 100644 --- a/apps/server/src/modules/account/repo/micro-orm/account.repo.integration.spec.ts +++ b/apps/server/src/modules/account/repo/micro-orm/account.repo.integration.spec.ts @@ -3,7 +3,7 @@ import { NotFoundError } from '@mikro-orm/core'; import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { User } from '@shared/domain/entity'; -import { cleanupCollections, userFactory } from '@shared/testing'; +import { cleanupCollections, userFactory } from '@shared/testing/factory'; import { AccountRepo } from './account.repo'; import { AccountEntity } from '../../domain/entity/account.entity'; import { AccountDoToEntityMapper } from './mapper/account-do-to-entity.mapper'; diff --git a/apps/server/src/modules/alert/adapter/status.adapter.spec.ts b/apps/server/src/modules/alert/adapter/status.adapter.spec.ts index c35c17bd001..fd8f6352757 100644 --- a/apps/server/src/modules/alert/adapter/status.adapter.spec.ts +++ b/apps/server/src/modules/alert/adapter/status.adapter.spec.ts @@ -3,7 +3,7 @@ import { HttpService } from '@nestjs/axios'; import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ConfigService } from '@nestjs/config'; import { ServerConfig } from '@modules/server'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { of, throwError } from 'rxjs'; import { AxiosError } from 'axios'; import { StatusAdapter } from './status.adapter'; diff --git a/apps/server/src/modules/alert/controller/api-test/alert.api.spec.ts b/apps/server/src/modules/alert/controller/api-test/alert.api.spec.ts index 4913bdf0fad..6f2595c0c85 100644 --- a/apps/server/src/modules/alert/controller/api-test/alert.api.spec.ts +++ b/apps/server/src/modules/alert/controller/api-test/alert.api.spec.ts @@ -4,7 +4,7 @@ import { HttpService } from '@nestjs/axios'; import { Test, TestingModule } from '@nestjs/testing'; import request from 'supertest'; import { of } from 'rxjs'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { SchulcloudTheme } from '@shared/domain/types'; import { serverConfig, ServerTestModule } from '../../../server'; import { createComponent, createIncident } from '../../testing'; diff --git a/apps/server/src/modules/authentication/controllers/api-test/login.api.spec.ts b/apps/server/src/modules/authentication/controllers/api-test/login.api.spec.ts index 29fa84dc438..57a28b76194 100644 --- a/apps/server/src/modules/authentication/controllers/api-test/login.api.spec.ts +++ b/apps/server/src/modules/authentication/controllers/api-test/login.api.spec.ts @@ -5,7 +5,7 @@ import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { SchoolEntity, SystemEntity, User } from '@shared/domain/entity'; import { RoleName } from '@shared/domain/interface'; -import { roleFactory, schoolEntityFactory, systemEntityFactory, userFactory } from '@shared/testing'; +import { roleFactory, schoolEntityFactory, systemEntityFactory, userFactory } from '@shared/testing/factory'; import { AccountEntity } from '@src/modules/account/domain/entity/account.entity'; import { accountFactory } from '@src/modules/account/testing'; import axios from 'axios'; diff --git a/apps/server/src/modules/authentication/mapper/current-user.mapper.spec.ts b/apps/server/src/modules/authentication/mapper/current-user.mapper.spec.ts index c852b725fd3..b3e73986517 100644 --- a/apps/server/src/modules/authentication/mapper/current-user.mapper.spec.ts +++ b/apps/server/src/modules/authentication/mapper/current-user.mapper.spec.ts @@ -1,7 +1,7 @@ import { ValidationError } from '@shared/common'; import { UserDO } from '@shared/domain/domainobject/user.do'; import { Permission, RoleName } from '@shared/domain/interface'; -import { roleFactory, schoolEntityFactory, setupEntities, userDoFactory, userFactory } from '@shared/testing'; +import { roleFactory, schoolEntityFactory, setupEntities, userDoFactory, userFactory } from '@shared/testing/factory'; import { ICurrentUser, OauthCurrentUser } from '../interface'; import { CreateJwtPayload, JwtPayload } from '../interface/jwt-payload'; import { CurrentUserMapper } from './current-user.mapper'; diff --git a/apps/server/src/modules/authentication/services/ldap.service.spec.ts b/apps/server/src/modules/authentication/services/ldap.service.spec.ts index 22f27573d3d..7ead2a65d1a 100644 --- a/apps/server/src/modules/authentication/services/ldap.service.spec.ts +++ b/apps/server/src/modules/authentication/services/ldap.service.spec.ts @@ -2,7 +2,7 @@ import { createMock } from '@golevelup/ts-jest'; import { UnauthorizedException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { SystemEntity } from '@shared/domain/entity'; -import { systemEntityFactory } from '@shared/testing'; +import { systemEntityFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { LdapService } from './ldap.service'; diff --git a/apps/server/src/modules/authentication/strategy/local.strategy.spec.ts b/apps/server/src/modules/authentication/strategy/local.strategy.spec.ts index a28a2d362b6..c40d006db78 100644 --- a/apps/server/src/modules/authentication/strategy/local.strategy.spec.ts +++ b/apps/server/src/modules/authentication/strategy/local.strategy.spec.ts @@ -7,7 +7,7 @@ import { ConfigService } from '@nestjs/config'; import { User } from '@shared/domain/entity'; import { RoleName } from '@shared/domain/interface'; import { UserRepo } from '@shared/repo'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { accountDoFactory } from '@src/modules/account/testing'; import bcrypt from 'bcryptjs'; import { AuthenticationService } from '../services/authentication.service'; diff --git a/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts b/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts index 1263161ea90..02a4abf27be 100644 --- a/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts +++ b/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts @@ -6,7 +6,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { UserDO } from '@shared/domain/domainobject/user.do'; import { RoleName } from '@shared/domain/interface'; import { EntityId } from '@shared/domain/types'; -import { userDoFactory } from '@shared/testing'; +import { userDoFactory } from '@shared/testing/factory'; import { ICurrentUser, OauthCurrentUser } from '../interface'; diff --git a/apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.spec.ts index 132bf8fcaf6..913e9279dad 100644 --- a/apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.spec.ts @@ -7,7 +7,7 @@ import { schoolExternalToolEntityFactory } from '@modules/tool/school-external-t import { Test, TestingModule } from '@nestjs/testing'; import { Role, User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { roleFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing'; +import { roleFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { AuthorizationHelper } from '../service/authorization.helper'; import { Action } from '../type'; import { ContextExternalToolRule } from './context-external-tool.rule'; diff --git a/apps/server/src/modules/authorization/domain/rules/course-group.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/course-group.rule.spec.ts index 62c14baa138..e5e5d183c2b 100644 --- a/apps/server/src/modules/authorization/domain/rules/course-group.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/course-group.rule.spec.ts @@ -1,7 +1,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { CourseGroup, User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { courseFactory, courseGroupFactory, roleFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory, courseGroupFactory, roleFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { CourseGroupRule } from './course-group.rule'; import { CourseRule } from './course.rule'; import { Action } from '../type'; diff --git a/apps/server/src/modules/authorization/domain/rules/course.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/course.rule.spec.ts index d66b7856ca9..19be1463be7 100644 --- a/apps/server/src/modules/authorization/domain/rules/course.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/course.rule.spec.ts @@ -2,7 +2,7 @@ import { courseFactory } from '@modules/learnroom/testing'; import { Test, TestingModule } from '@nestjs/testing'; import { Course, User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { courseFactory as courseEntityFactory, roleFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory as courseEntityFactory, roleFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { AuthorizationHelper } from '../service/authorization.helper'; import { Action } from '../type'; import { CourseRule } from './course.rule'; diff --git a/apps/server/src/modules/authorization/domain/rules/group.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/group.rule.spec.ts index dcc1f39b753..f964a847647 100644 --- a/apps/server/src/modules/authorization/domain/rules/group.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/group.rule.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; import { Role, SchoolEntity, User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { groupFactory, roleFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing'; +import { groupFactory, roleFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { Action, AuthorizationContext, AuthorizationHelper } from '@src/modules/authorization'; import { Group } from '@src/modules/group'; import { ObjectId } from '@mikro-orm/mongodb'; diff --git a/apps/server/src/modules/authorization/domain/rules/legacy-school.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/legacy-school.rule.spec.ts index 732c6625ce5..be8bc96fe58 100644 --- a/apps/server/src/modules/authorization/domain/rules/legacy-school.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/legacy-school.rule.spec.ts @@ -1,6 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; -import { roleFactory, legacySchoolDoFactory, setupEntities, userFactory } from '@shared/testing'; +import { roleFactory, legacySchoolDoFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { Action } from '../type'; import { AuthorizationHelper } from '../service/authorization.helper'; diff --git a/apps/server/src/modules/authorization/domain/rules/school.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/school.rule.spec.ts index e5ff909f491..2b85af00999 100644 --- a/apps/server/src/modules/authorization/domain/rules/school.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/school.rule.spec.ts @@ -1,7 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { schoolFactory } from '@modules/school/testing/school.factory'; import { Test, TestingModule } from '@nestjs/testing'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { AuthorizationContextBuilder } from '../mapper'; import { AuthorizationHelper } from '../service/authorization.helper'; import { SchoolRule } from './school.rule'; diff --git a/apps/server/src/modules/authorization/domain/rules/system.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/system.rule.spec.ts index 8fb4d0173ba..dbaf3735951 100644 --- a/apps/server/src/modules/authorization/domain/rules/system.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/system.rule.spec.ts @@ -3,7 +3,13 @@ import { System } from '@modules/system'; import { Test, TestingModule } from '@nestjs/testing'; import { SchoolEntity, SystemEntity, User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { schoolEntityFactory, setupEntities, systemEntityFactory, systemFactory, userFactory } from '@shared/testing'; +import { + schoolEntityFactory, + setupEntities, + systemEntityFactory, + systemFactory, + userFactory, +} from '@shared/testing/factory'; import { AuthorizationContextBuilder } from '../mapper'; import { AuthorizationHelper } from '../service/authorization.helper'; import { SystemRule } from './system.rule'; diff --git a/apps/server/src/modules/authorization/domain/rules/task.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/task.rule.spec.ts index aa32062c7af..a0de164b3c1 100644 --- a/apps/server/src/modules/authorization/domain/rules/task.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/task.rule.spec.ts @@ -1,7 +1,14 @@ import { DeepPartial } from '@mikro-orm/core'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission, RoleName } from '@shared/domain/interface'; -import { courseFactory, lessonFactory, roleFactory, setupEntities, taskFactory, userFactory } from '@shared/testing'; +import { + courseFactory, + lessonFactory, + roleFactory, + setupEntities, + taskFactory, + userFactory, +} from '@shared/testing/factory'; import { AuthorizationHelper } from '../service/authorization.helper'; import { Action } from '../type'; import { CourseGroupRule } from './course-group.rule'; diff --git a/apps/server/src/modules/authorization/domain/rules/team.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/team.rule.spec.ts index da99354a49b..200ef5dc4af 100644 --- a/apps/server/src/modules/authorization/domain/rules/team.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/team.rule.spec.ts @@ -1,6 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; -import { roleFactory, setupEntities, userFactory, teamFactory } from '@shared/testing'; +import { roleFactory, setupEntities, userFactory, teamFactory } from '@shared/testing/factory'; import { AuthorizationHelper } from '../service/authorization.helper'; import { TeamRule } from './team.rule'; import { AuthorizationContextBuilder } from '../mapper'; diff --git a/apps/server/src/modules/authorization/domain/rules/user-login-migration.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/user-login-migration.rule.spec.ts index 6ee893fc9d2..f173c35e765 100644 --- a/apps/server/src/modules/authorization/domain/rules/user-login-migration.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/user-login-migration.rule.spec.ts @@ -3,7 +3,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { UserLoginMigrationDO } from '@shared/domain/domainobject'; import { Permission } from '@shared/domain/interface'; -import { schoolEntityFactory, setupEntities, userFactory, userLoginMigrationDOFactory } from '@shared/testing'; +import { schoolEntityFactory, setupEntities, userFactory, userLoginMigrationDOFactory } from '@shared/testing/factory'; import { AuthorizationHelper } from '../service/authorization.helper'; import { Action, AuthorizationContext } from '../type'; import { UserLoginMigrationRule } from './user-login-migration.rule'; diff --git a/apps/server/src/modules/authorization/domain/rules/user.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/user.rule.spec.ts index 85492348f75..d50e00c16f7 100644 --- a/apps/server/src/modules/authorization/domain/rules/user.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/user.rule.spec.ts @@ -1,7 +1,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Role, User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { roleFactory, setupEntities, userFactory } from '@shared/testing'; +import { roleFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { Action } from '../type'; import { AuthorizationHelper } from '../service/authorization.helper'; import { UserRule } from './user.rule'; diff --git a/apps/server/src/modules/authorization/domain/service/authorization-reference.service.spec.ts b/apps/server/src/modules/authorization/domain/service/authorization-reference.service.spec.ts index 61fd573fb88..dbf95838915 100644 --- a/apps/server/src/modules/authorization/domain/service/authorization-reference.service.spec.ts +++ b/apps/server/src/modules/authorization/domain/service/authorization-reference.service.spec.ts @@ -1,7 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { NotFoundException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { courseFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { AuthorizableReferenceType } from '../type'; import { AuthorizationService } from './authorization.service'; diff --git a/apps/server/src/modules/authorization/domain/service/authorization.service.spec.ts b/apps/server/src/modules/authorization/domain/service/authorization.service.spec.ts index afe0fd8c5c4..f1986a5f0ac 100644 --- a/apps/server/src/modules/authorization/domain/service/authorization.service.spec.ts +++ b/apps/server/src/modules/authorization/domain/service/authorization.service.spec.ts @@ -3,7 +3,7 @@ import { UnauthorizedException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; import { UserRepo } from '@shared/repo'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { ForbiddenLoggableException } from '../error'; import { AuthorizationContextBuilder } from '../mapper'; import { Rule } from '../type'; diff --git a/apps/server/src/modules/authorization/domain/service/reference.loader.spec.ts b/apps/server/src/modules/authorization/domain/service/reference.loader.spec.ts index 77e04a3c1ba..6df695f1905 100644 --- a/apps/server/src/modules/authorization/domain/service/reference.loader.spec.ts +++ b/apps/server/src/modules/authorization/domain/service/reference.loader.spec.ts @@ -16,7 +16,7 @@ import { TeamsRepo, UserRepo, } from '@shared/repo'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { AuthorizableReferenceType } from '../type'; import { ReferenceLoader } from './reference.loader'; diff --git a/apps/server/src/modules/authorization/domain/service/rule-manager.spec.ts b/apps/server/src/modules/authorization/domain/service/rule-manager.spec.ts index a5d08f5c061..c6b68d426a7 100644 --- a/apps/server/src/modules/authorization/domain/service/rule-manager.spec.ts +++ b/apps/server/src/modules/authorization/domain/service/rule-manager.spec.ts @@ -1,7 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { InternalServerErrorException, NotImplementedException } from '@nestjs/common'; import { Test } from '@nestjs/testing'; -import { courseFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { AuthorizationContextBuilder } from '../mapper'; import { BoardDoRule, diff --git a/apps/server/src/modules/board/controller/api-test/board-create.api.spec.ts b/apps/server/src/modules/board/controller/api-test/board-create.api.spec.ts index 433a00fef5c..95d94afc8b7 100644 --- a/apps/server/src/modules/board/controller/api-test/board-create.api.spec.ts +++ b/apps/server/src/modules/board/controller/api-test/board-create.api.spec.ts @@ -4,7 +4,7 @@ import { INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { BoardExternalReferenceType, BoardLayout } from '@shared/domain/domainobject'; import { ColumnBoardNode } from '@shared/domain/entity'; -import { cleanupCollections, courseFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; +import { cleanupCollections, courseFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing/factory'; import { CreateBoardBodyParams } from '../dto'; const baseRouteName = '/boards'; diff --git a/apps/server/src/modules/board/controller/media-board/api-test/media-line.api.spec.ts b/apps/server/src/modules/board/controller/media-board/api-test/media-line.api.spec.ts index 5acbde0b818..1237501153e 100644 --- a/apps/server/src/modules/board/controller/media-board/api-test/media-line.api.spec.ts +++ b/apps/server/src/modules/board/controller/media-board/api-test/media-line.api.spec.ts @@ -4,7 +4,12 @@ import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { BoardExternalReferenceType } from '@shared/domain/domainobject'; import { BoardNode } from '@shared/domain/entity'; -import { mediaBoardNodeFactory, mediaLineNodeFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; +import { + mediaBoardNodeFactory, + mediaLineNodeFactory, + TestApiClient, + UserAndAccountTestFactory, +} from '@shared/testing/factory'; import { MoveColumnBodyParams, RenameBodyParams } from '../../dto'; const baseRouteName = '/media-lines'; diff --git a/apps/server/src/modules/board/service/event/user-deleted-event-handler.service.spec.ts b/apps/server/src/modules/board/service/event/user-deleted-event-handler.service.spec.ts index 9f37c5aea7a..008e0f07a9e 100644 --- a/apps/server/src/modules/board/service/event/user-deleted-event-handler.service.spec.ts +++ b/apps/server/src/modules/board/service/event/user-deleted-event-handler.service.spec.ts @@ -3,7 +3,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { EventBus } from '@nestjs/cqrs'; import { Test, TestingModule } from '@nestjs/testing'; import { BoardExternalReferenceType } from '@shared/domain/domainobject'; -import { mediaBoardFactory } from '@shared/testing'; +import { mediaBoardFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { DataDeletedEvent, diff --git a/apps/server/src/modules/board/service/media-board/media-board.service.spec.ts b/apps/server/src/modules/board/service/media-board/media-board.service.spec.ts index a7c834cb7d4..de1a824787d 100644 --- a/apps/server/src/modules/board/service/media-board/media-board.service.spec.ts +++ b/apps/server/src/modules/board/service/media-board/media-board.service.spec.ts @@ -2,7 +2,7 @@ import { createMock, type DeepMocked } from '@golevelup/ts-jest'; import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { BoardExternalReferenceType } from '@shared/domain/domainobject'; -import { mediaBoardFactory, mediaLineFactory } from '@shared/testing'; +import { mediaBoardFactory, mediaLineFactory } from '@shared/testing/factory'; import { BoardDoRepo } from '../../repo'; import { BoardDoService } from '../board-do.service'; import { MediaBoardService } from './media-board.service'; diff --git a/apps/server/src/modules/board/service/media-board/media-line.service.spec.ts b/apps/server/src/modules/board/service/media-board/media-line.service.spec.ts index dd15f1e0894..b09aa82c5fd 100644 --- a/apps/server/src/modules/board/service/media-board/media-line.service.spec.ts +++ b/apps/server/src/modules/board/service/media-board/media-line.service.spec.ts @@ -1,6 +1,6 @@ import { createMock, type DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; -import { mediaBoardFactory, mediaLineFactory } from '@shared/testing'; +import { mediaBoardFactory, mediaLineFactory } from '@shared/testing/factory'; import { BoardDoRepo } from '../../repo'; import { BoardDoService } from '../board-do.service'; import { MediaLineService } from './media-line.service'; diff --git a/apps/server/src/modules/board/service/submission-item.service.spec.ts b/apps/server/src/modules/board/service/submission-item.service.spec.ts index d95e7657cd2..ca6532dc67e 100644 --- a/apps/server/src/modules/board/service/submission-item.service.spec.ts +++ b/apps/server/src/modules/board/service/submission-item.service.spec.ts @@ -3,7 +3,7 @@ import { NotFoundException, UnprocessableEntityException } from '@nestjs/common' import { Test, TestingModule } from '@nestjs/testing'; import { ValidationError } from '@shared/common'; import { SubmissionItem } from '@shared/domain/domainobject'; -import { richTextElementFactory, setupEntities, userFactory } from '@shared/testing'; +import { richTextElementFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { cardFactory, submissionContainerElementFactory, diff --git a/apps/server/src/modules/board/uc/board.uc.spec.ts b/apps/server/src/modules/board/uc/board.uc.spec.ts index 3fcde3b1754..51e403dbcca 100644 --- a/apps/server/src/modules/board/uc/board.uc.spec.ts +++ b/apps/server/src/modules/board/uc/board.uc.spec.ts @@ -4,7 +4,7 @@ import { ForbiddenException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { BoardDoAuthorizable, BoardRoles, ContentElementType } from '@shared/domain/domainobject'; import { CourseRepo } from '@shared/repo'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { columnBoardFactory, columnFactory } from '@shared/testing/factory/domainobject'; import { LegacyLogger } from '@src/core/logger'; import { ObjectId } from '@mikro-orm/mongodb'; diff --git a/apps/server/src/modules/board/uc/card.uc.spec.ts b/apps/server/src/modules/board/uc/card.uc.spec.ts index da42e9ec4aa..37708d4f4e4 100644 --- a/apps/server/src/modules/board/uc/card.uc.spec.ts +++ b/apps/server/src/modules/board/uc/card.uc.spec.ts @@ -3,7 +3,7 @@ import { AuthorizationService } from '@modules/authorization'; import { HttpService } from '@nestjs/axios'; import { Test, TestingModule } from '@nestjs/testing'; import { BoardDoAuthorizable, BoardRoles, ContentElementType } from '@shared/domain/domainobject'; -import { columnBoardFactory, columnFactory, setupEntities, userFactory } from '@shared/testing'; +import { columnBoardFactory, columnFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { cardFactory, richTextElementFactory } from '@shared/testing/factory/domainobject'; import { LegacyLogger } from '@src/core/logger'; import { ObjectId } from '@mikro-orm/mongodb'; diff --git a/apps/server/src/modules/board/uc/column.uc.spec.ts b/apps/server/src/modules/board/uc/column.uc.spec.ts index 67111077911..3a27f2b3afb 100644 --- a/apps/server/src/modules/board/uc/column.uc.spec.ts +++ b/apps/server/src/modules/board/uc/column.uc.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { AuthorizationService } from '@modules/authorization'; import { Test, TestingModule } from '@nestjs/testing'; import { BoardDoAuthorizable, BoardRoles, ContentElementType } from '@shared/domain/domainobject'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { cardFactory, columnBoardFactory, columnFactory } from '@shared/testing/factory/domainobject'; import { LegacyLogger } from '@src/core/logger'; import { BoardDoAuthorizableService, CardService, ColumnService, ContentElementService } from '../service'; diff --git a/apps/server/src/modules/class/domain/testing/factory/class.factory.ts b/apps/server/src/modules/class/domain/testing/factory/class.factory.ts index 63ae07d6809..eb54422175a 100644 --- a/apps/server/src/modules/class/domain/testing/factory/class.factory.ts +++ b/apps/server/src/modules/class/domain/testing/factory/class.factory.ts @@ -1,4 +1,4 @@ -import { DoBaseFactory } from '@shared/testing'; +import { DoBaseFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { DeepPartial } from 'fishery'; import { Class, ClassProps } from '../../class.do'; diff --git a/apps/server/src/modules/class/repo/classes.repo.spec.ts b/apps/server/src/modules/class/repo/classes.repo.spec.ts index 9904a627e6c..5cb67eb7b0d 100644 --- a/apps/server/src/modules/class/repo/classes.repo.spec.ts +++ b/apps/server/src/modules/class/repo/classes.repo.spec.ts @@ -5,7 +5,7 @@ import { Test } from '@nestjs/testing'; import { TestingModule } from '@nestjs/testing/testing-module'; import { NotFoundLoggableException } from '@shared/common/loggable-exception'; import { SchoolEntity } from '@shared/domain/entity'; -import { cleanupCollections, schoolEntityFactory } from '@shared/testing'; +import { cleanupCollections, schoolEntityFactory } from '@shared/testing/factory'; import { Class } from '../domain'; import { ClassEntity } from '../entity'; import { ClassesRepo } from './classes.repo'; diff --git a/apps/server/src/modules/deletion-console/deletion-client/deletion.client.spec.ts b/apps/server/src/modules/deletion-console/deletion-client/deletion.client.spec.ts index 478f23a2348..636adef3696 100644 --- a/apps/server/src/modules/deletion-console/deletion-client/deletion.client.spec.ts +++ b/apps/server/src/modules/deletion-console/deletion-client/deletion.client.spec.ts @@ -4,7 +4,7 @@ import { HttpService } from '@nestjs/axios'; import { ConfigService } from '@nestjs/config'; import { Test, TestingModule } from '@nestjs/testing'; import { createMock, DeepMocked } from '@golevelup/ts-jest'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { DeletionRequestInputBuilder, DeletionRequestOutputBuilder } from '.'; import { DeletionRequestOutput } from './interface'; import { DeletionClient } from './deletion.client'; diff --git a/apps/server/src/modules/deletion/domain/testing/factory/deletion-log.factory.ts b/apps/server/src/modules/deletion/domain/testing/factory/deletion-log.factory.ts index 802f8189714..3ca888e400d 100644 --- a/apps/server/src/modules/deletion/domain/testing/factory/deletion-log.factory.ts +++ b/apps/server/src/modules/deletion/domain/testing/factory/deletion-log.factory.ts @@ -1,4 +1,4 @@ -import { DoBaseFactory } from '@shared/testing'; +import { DoBaseFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { DomainOperationReportBuilder, DomainDeletionReportBuilder } from '../../builder'; import { DeletionLog, DeletionLogProps } from '../../do'; diff --git a/apps/server/src/modules/deletion/domain/testing/factory/deletion-request.factory.ts b/apps/server/src/modules/deletion/domain/testing/factory/deletion-request.factory.ts index d10fbd9defd..a1421084bed 100644 --- a/apps/server/src/modules/deletion/domain/testing/factory/deletion-request.factory.ts +++ b/apps/server/src/modules/deletion/domain/testing/factory/deletion-request.factory.ts @@ -1,4 +1,4 @@ -import { DoBaseFactory } from '@shared/testing'; +import { DoBaseFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { DeepPartial } from 'fishery'; import { DeletionRequest, DeletionRequestProps } from '../../do'; diff --git a/apps/server/src/modules/deletion/repo/entity/testing/factory/deletion-log.entity.factory.ts b/apps/server/src/modules/deletion/repo/entity/testing/factory/deletion-log.entity.factory.ts index faf0ade5bf8..ed92e13a784 100644 --- a/apps/server/src/modules/deletion/repo/entity/testing/factory/deletion-log.entity.factory.ts +++ b/apps/server/src/modules/deletion/repo/entity/testing/factory/deletion-log.entity.factory.ts @@ -1,4 +1,4 @@ -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { DomainOperationReportBuilder, DomainDeletionReportBuilder } from '@src/modules/deletion/domain/builder'; import { DomainName, OperationType } from '@src/modules/deletion/domain/types'; import { ObjectId } from 'bson'; diff --git a/apps/server/src/modules/deletion/repo/entity/testing/factory/deletion-request.entity.factory.ts b/apps/server/src/modules/deletion/repo/entity/testing/factory/deletion-request.entity.factory.ts index 4629a3fbdb8..3cfcbfc3abc 100644 --- a/apps/server/src/modules/deletion/repo/entity/testing/factory/deletion-request.entity.factory.ts +++ b/apps/server/src/modules/deletion/repo/entity/testing/factory/deletion-request.entity.factory.ts @@ -1,4 +1,4 @@ -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { DomainName, StatusModel } from '@src/modules/deletion/domain/types'; import { ObjectId } from 'bson'; import { DeletionRequestEntity, DeletionRequestEntityProps } from '../../deletion-request.entity'; diff --git a/apps/server/src/modules/files-storage-client/mapper/copy-files-of-parent-param.builder.spec.ts b/apps/server/src/modules/files-storage-client/mapper/copy-files-of-parent-param.builder.spec.ts index ccce67a089a..8134c60cd99 100644 --- a/apps/server/src/modules/files-storage-client/mapper/copy-files-of-parent-param.builder.spec.ts +++ b/apps/server/src/modules/files-storage-client/mapper/copy-files-of-parent-param.builder.spec.ts @@ -1,6 +1,6 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { FileRecordParentType } from '@infra/rabbitmq'; -import { lessonFactory, setupEntities, taskFactory } from '@shared/testing'; +import { lessonFactory, setupEntities, taskFactory } from '@shared/testing/factory'; import { CopyFilesOfParentParamBuilder } from './copy-files-of-parent-param.builder'; import { FileParamBuilder } from './files-storage-param.builder'; diff --git a/apps/server/src/modules/files-storage-client/mapper/files-storage-param.builder.spec.ts b/apps/server/src/modules/files-storage-client/mapper/files-storage-param.builder.spec.ts index 23ce4f7e175..1b7f7fe6850 100644 --- a/apps/server/src/modules/files-storage-client/mapper/files-storage-param.builder.spec.ts +++ b/apps/server/src/modules/files-storage-client/mapper/files-storage-param.builder.spec.ts @@ -1,5 +1,5 @@ import { FileRecordParentType } from '@infra/rabbitmq'; -import { lessonFactory, setupEntities, taskFactory } from '@shared/testing'; +import { lessonFactory, setupEntities, taskFactory } from '@shared/testing/factory'; import { FileParamBuilder } from './files-storage-param.builder'; describe('FileParamBuilder', () => { diff --git a/apps/server/src/modules/files-storage-client/service/files-storage-client.service.spec.ts b/apps/server/src/modules/files-storage-client/service/files-storage-client.service.spec.ts index eadc24ac8cc..0970e213588 100644 --- a/apps/server/src/modules/files-storage-client/service/files-storage-client.service.spec.ts +++ b/apps/server/src/modules/files-storage-client/service/files-storage-client.service.spec.ts @@ -1,7 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; -import { schoolEntityFactory, setupEntities, taskFactory } from '@shared/testing'; +import { schoolEntityFactory, setupEntities, taskFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { FileRecordParentType } from '@infra/rabbitmq'; import { EventBus } from '@nestjs/cqrs'; diff --git a/apps/server/src/modules/files-storage/mapper/file-dto.builder.spec.ts b/apps/server/src/modules/files-storage/mapper/file-dto.builder.spec.ts index 884c1afe47f..20fb24052d9 100644 --- a/apps/server/src/modules/files-storage/mapper/file-dto.builder.spec.ts +++ b/apps/server/src/modules/files-storage/mapper/file-dto.builder.spec.ts @@ -1,5 +1,5 @@ import { createMock } from '@golevelup/ts-jest'; -import { fileRecordFactory } from '@shared/testing'; +import { fileRecordFactory } from '@shared/testing/factory'; import { AxiosResponse } from 'axios'; import { Readable } from 'stream'; import { FileDto } from '../dto'; diff --git a/apps/server/src/modules/files-storage/mapper/preview.builder.spec.ts b/apps/server/src/modules/files-storage/mapper/preview.builder.spec.ts index 1a3cc843f86..25d8e90813d 100644 --- a/apps/server/src/modules/files-storage/mapper/preview.builder.spec.ts +++ b/apps/server/src/modules/files-storage/mapper/preview.builder.spec.ts @@ -1,4 +1,4 @@ -import { fileRecordFactory } from '@shared/testing'; +import { fileRecordFactory } from '@shared/testing/factory'; import { PreviewOutputMimeTypes } from '../interface'; import { PreviewBuilder } from './preview.builder'; diff --git a/apps/server/src/modules/files-storage/repo/filerecord.repo.integration.spec.ts b/apps/server/src/modules/files-storage/repo/filerecord.repo.integration.spec.ts index 7fa1853bc05..b35a9c504e1 100644 --- a/apps/server/src/modules/files-storage/repo/filerecord.repo.integration.spec.ts +++ b/apps/server/src/modules/files-storage/repo/filerecord.repo.integration.spec.ts @@ -1,6 +1,6 @@ import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; -import { cleanupCollections, fileRecordFactory } from '@shared/testing'; +import { cleanupCollections, fileRecordFactory } from '@shared/testing/factory'; import { MongoMemoryDatabaseModule } from '@infra/database'; diff --git a/apps/server/src/modules/files/entity/file.entity.spec.ts b/apps/server/src/modules/files/entity/file.entity.spec.ts index bf52769f32b..aa4ed803de9 100644 --- a/apps/server/src/modules/files/entity/file.entity.spec.ts +++ b/apps/server/src/modules/files/entity/file.entity.spec.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { setupEntities, storageProviderFactory } from '@shared/testing'; +import { setupEntities, storageProviderFactory } from '@shared/testing/factory'; import { FileOwnerModel } from '@modules/files/domain'; import { fileEntityFactory, filePermissionEntityFactory } from './testing'; import { FileEntity } from './file.entity'; diff --git a/apps/server/src/modules/files/entity/testing/factory/file-entity.factory.ts b/apps/server/src/modules/files/entity/testing/factory/file-entity.factory.ts index 00f07dd04c7..c006778af2b 100644 --- a/apps/server/src/modules/files/entity/testing/factory/file-entity.factory.ts +++ b/apps/server/src/modules/files/entity/testing/factory/file-entity.factory.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { BaseFactory, storageProviderFactory } from '@shared/testing'; +import { BaseFactory, storageProviderFactory } from '@shared/testing/factory'; import { FileEntity, FileEntityProps } from '../..'; import { FileOwnerModel } from '../../../domain'; import { filePermissionEntityFactory } from './file-permission-entity.factory'; diff --git a/apps/server/src/modules/files/entity/testing/factory/file-permission-entity.factory.ts b/apps/server/src/modules/files/entity/testing/factory/file-permission-entity.factory.ts index e0eebb815ff..28649f5ced8 100644 --- a/apps/server/src/modules/files/entity/testing/factory/file-permission-entity.factory.ts +++ b/apps/server/src/modules/files/entity/testing/factory/file-permission-entity.factory.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { FilePermissionEntity, FilePermissionEntityProps } from '../..'; import { FilePermissionReferenceModel } from '../../../domain'; diff --git a/apps/server/src/modules/files/uc/delete-files.uc.spec.ts b/apps/server/src/modules/files/uc/delete-files.uc.spec.ts index 1409d31400d..8a325b44cd5 100644 --- a/apps/server/src/modules/files/uc/delete-files.uc.spec.ts +++ b/apps/server/src/modules/files/uc/delete-files.uc.spec.ts @@ -4,7 +4,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; import { ObjectId } from '@mikro-orm/mongodb'; import { StorageProviderRepo } from '@shared/repo/storageprovider'; -import { storageProviderFactory } from '@shared/testing'; +import { storageProviderFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { DeleteFilesUc } from './delete-files.uc'; import { FilesRepo } from '../repo'; diff --git a/apps/server/src/modules/group/domain/group.spec.ts b/apps/server/src/modules/group/domain/group.spec.ts index 65018e0eb45..aa53b09c5c2 100644 --- a/apps/server/src/modules/group/domain/group.spec.ts +++ b/apps/server/src/modules/group/domain/group.spec.ts @@ -1,5 +1,5 @@ import { RoleReference, UserDO } from '@shared/domain/domainobject'; -import { groupFactory, roleFactory, userDoFactory } from '@shared/testing'; +import { groupFactory, roleFactory, userDoFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { Group } from './group'; diff --git a/apps/server/src/modules/group/service/group.service.spec.ts b/apps/server/src/modules/group/service/group.service.spec.ts index ca115317e9c..e749306b8b7 100644 --- a/apps/server/src/modules/group/service/group.service.spec.ts +++ b/apps/server/src/modules/group/service/group.service.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { NotFoundLoggableException } from '@shared/common/loggable-exception'; import { Page } from '@shared/domain/domainobject'; import { EntityId } from '@shared/domain/types'; -import { groupFactory } from '@shared/testing'; +import { groupFactory } from '@shared/testing/factory'; import { Group, GroupDeletedEvent, GroupTypes } from '../domain'; import { GroupRepo } from '../repo'; import { GroupService } from './group.service'; diff --git a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-ajax.api.spec.ts b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-ajax.api.spec.ts index 0c7251e6134..ccc7b5136cd 100644 --- a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-ajax.api.spec.ts +++ b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-ajax.api.spec.ts @@ -4,7 +4,7 @@ import { EntityManager } from '@mikro-orm/core'; import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import { S3ClientAdapter } from '@infra/s3-client'; -import { TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; +import { TestApiClient, UserAndAccountTestFactory } from '@shared/testing/factory'; import { H5PEditorTestModule } from '../../h5p-editor-test.module'; import { H5P_CONTENT_S3_CONNECTION, H5P_LIBRARIES_S3_CONNECTION } from '../../h5p-editor.config'; diff --git a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-save-create.api.spec.ts b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-save-create.api.spec.ts index 0e1d5a13686..934eef15838 100644 --- a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-save-create.api.spec.ts +++ b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-save-create.api.spec.ts @@ -4,7 +4,7 @@ import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import { S3ClientAdapter } from '@infra/s3-client'; -import { TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; +import { TestApiClient, UserAndAccountTestFactory } from '@shared/testing/factory'; import { H5PContentParentType } from '../../entity'; import { H5PEditorTestModule } from '../../h5p-editor-test.module'; import { H5P_CONTENT_S3_CONNECTION, H5P_LIBRARIES_S3_CONNECTION } from '../../h5p-editor.config'; diff --git a/apps/server/src/modules/h5p-editor/repo/h5p-content.repo.integration.spec.ts b/apps/server/src/modules/h5p-editor/repo/h5p-content.repo.integration.spec.ts index f9672ffb3ce..415a560790e 100644 --- a/apps/server/src/modules/h5p-editor/repo/h5p-content.repo.integration.spec.ts +++ b/apps/server/src/modules/h5p-editor/repo/h5p-content.repo.integration.spec.ts @@ -1,7 +1,7 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { MongoMemoryDatabaseModule } from '@infra/database'; -import { cleanupCollections, h5pContentFactory } from '@shared/testing'; +import { cleanupCollections, h5pContentFactory } from '@shared/testing/factory'; import { H5PContent } from '../entity'; import { H5PContentRepo } from './h5p-content.repo'; diff --git a/apps/server/src/modules/learnroom/controller/api-test/dashboard.api.spec.ts b/apps/server/src/modules/learnroom/controller/api-test/dashboard.api.spec.ts index ace1c8d68c1..98f139359e6 100644 --- a/apps/server/src/modules/learnroom/controller/api-test/dashboard.api.spec.ts +++ b/apps/server/src/modules/learnroom/controller/api-test/dashboard.api.spec.ts @@ -8,7 +8,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { DashboardEntity, GridElement, User } from '@shared/domain/entity'; import { Permission, RoleName } from '@shared/domain/interface'; import { IDashboardRepo } from '@shared/repo'; -import { courseFactory, mapUserToCurrentUser, roleFactory, userFactory } from '@shared/testing'; +import { courseFactory, mapUserToCurrentUser, roleFactory, userFactory } from '@shared/testing/factory'; import { Request } from 'express'; import request from 'supertest'; diff --git a/apps/server/src/modules/learnroom/domain/loggable/course-synchronization-stopped.loggable.spec.ts b/apps/server/src/modules/learnroom/domain/loggable/course-synchronization-stopped.loggable.spec.ts index e797ca0eb67..dbc0ed5914e 100644 --- a/apps/server/src/modules/learnroom/domain/loggable/course-synchronization-stopped.loggable.spec.ts +++ b/apps/server/src/modules/learnroom/domain/loggable/course-synchronization-stopped.loggable.spec.ts @@ -1,4 +1,4 @@ -import { groupFactory } from '@shared/testing'; +import { groupFactory } from '@shared/testing/factory'; import { courseFactory } from '../../testing'; import { CourseSynchronizationStoppedLoggable } from './course-synchronization-stopped.loggable'; diff --git a/apps/server/src/modules/learnroom/mapper/rolename.mapper.spec.ts b/apps/server/src/modules/learnroom/mapper/rolename.mapper.spec.ts index 3123988eb95..f3cff3a64ed 100644 --- a/apps/server/src/modules/learnroom/mapper/rolename.mapper.spec.ts +++ b/apps/server/src/modules/learnroom/mapper/rolename.mapper.spec.ts @@ -1,6 +1,12 @@ import { Test, TestingModule } from '@nestjs/testing'; import { RoleName } from '@shared/domain/interface'; -import { UserAndAccountTestFactory, courseFactory, roleFactory, setupEntities, userFactory } from '@shared/testing'; +import { + UserAndAccountTestFactory, + courseFactory, + roleFactory, + setupEntities, + userFactory, +} from '@shared/testing/factory'; import { RoleNameMapper } from './rolename.mapper'; describe('rolename mapper', () => { diff --git a/apps/server/src/modules/learnroom/mapper/room-board-response.mapper.spec.ts b/apps/server/src/modules/learnroom/mapper/room-board-response.mapper.spec.ts index 36a5c9073c8..6cbbffffa12 100644 --- a/apps/server/src/modules/learnroom/mapper/room-board-response.mapper.spec.ts +++ b/apps/server/src/modules/learnroom/mapper/room-board-response.mapper.spec.ts @@ -1,7 +1,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { BoardLayout } from '@shared/domain/domainobject'; -import { courseFactory, setupEntities, taskFactory } from '@shared/testing'; +import { courseFactory, setupEntities, taskFactory } from '@shared/testing/factory'; import { BoardElementResponse, SingleColumnBoardResponse } from '../controller/dto'; import { ColumnBoardMetaData, RoomBoardDTO, RoomBoardElementTypes } from '../types'; import { RoomBoardResponseMapper } from './room-board-response.mapper'; diff --git a/apps/server/src/modules/learnroom/service/common-cartridge-import.service.spec.ts b/apps/server/src/modules/learnroom/service/common-cartridge-import.service.spec.ts index d99427618a9..abf64ab2ab4 100644 --- a/apps/server/src/modules/learnroom/service/common-cartridge-import.service.spec.ts +++ b/apps/server/src/modules/learnroom/service/common-cartridge-import.service.spec.ts @@ -1,7 +1,7 @@ import { DeepMocked, createMock } from '@golevelup/ts-jest'; import { MikroORM } from '@mikro-orm/core'; import { Test, TestingModule } from '@nestjs/testing'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { CardService, ColumnBoardService, ColumnService, ContentElementService } from '@src/modules/board'; import { readFile } from 'fs/promises'; import { CommonCartridgeImportMapper } from '../mapper/common-cartridge-import.mapper'; diff --git a/apps/server/src/modules/learnroom/service/course-do.service.spec.ts b/apps/server/src/modules/learnroom/service/course-do.service.spec.ts index b015194b5ee..0d7bb077feb 100644 --- a/apps/server/src/modules/learnroom/service/course-do.service.spec.ts +++ b/apps/server/src/modules/learnroom/service/course-do.service.spec.ts @@ -3,7 +3,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { Group } from '@modules/group'; import { Test, TestingModule } from '@nestjs/testing'; import { NotFoundLoggableException } from '@shared/common/loggable-exception'; -import { groupFactory } from '@shared/testing'; +import { groupFactory } from '@shared/testing/factory'; import { Course, COURSE_REPO, CourseNotSynchronizedLoggableException, CourseRepo } from '../domain'; import { courseFactory } from '../testing'; import { CourseDoService } from './course-do.service'; diff --git a/apps/server/src/modules/learnroom/service/course.service.spec.ts b/apps/server/src/modules/learnroom/service/course.service.spec.ts index c14f3e21b40..3909c8e7edc 100644 --- a/apps/server/src/modules/learnroom/service/course.service.spec.ts +++ b/apps/server/src/modules/learnroom/service/course.service.spec.ts @@ -11,7 +11,7 @@ import { EventBus } from '@nestjs/cqrs'; import { Test, TestingModule } from '@nestjs/testing'; import { Course as CourseEntity } from '@shared/domain/entity'; import { CourseRepo as LegacyCourseRepo, UserRepo } from '@shared/repo'; -import { courseFactory as courseEntityFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory as courseEntityFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { ObjectId } from 'bson'; import { CourseService } from './course.service'; diff --git a/apps/server/src/modules/learnroom/service/coursegroup.service.spec.ts b/apps/server/src/modules/learnroom/service/coursegroup.service.spec.ts index 97b4ec6c06d..dd184f8106c 100644 --- a/apps/server/src/modules/learnroom/service/coursegroup.service.spec.ts +++ b/apps/server/src/modules/learnroom/service/coursegroup.service.spec.ts @@ -1,7 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; import { CourseGroupRepo, UserRepo } from '@shared/repo'; -import { courseGroupFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseGroupFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { EventBus } from '@nestjs/cqrs'; import { ObjectId } from 'bson'; diff --git a/apps/server/src/modules/learnroom/service/dashboard.service.spec.ts b/apps/server/src/modules/learnroom/service/dashboard.service.spec.ts index e9150af68b5..0e6aa4b7176 100644 --- a/apps/server/src/modules/learnroom/service/dashboard.service.spec.ts +++ b/apps/server/src/modules/learnroom/service/dashboard.service.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; import { DashboardEntity, GridElement } from '@shared/domain/entity'; import { DashboardElementRepo, IDashboardRepo, UserRepo } from '@shared/repo'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { LearnroomMetadata, LearnroomTypes } from '@shared/domain/types'; import { Logger } from '@src/core/logger'; import { ObjectId } from 'bson'; diff --git a/apps/server/src/modules/learnroom/service/group-deleted-handler.service.spec.ts b/apps/server/src/modules/learnroom/service/group-deleted-handler.service.spec.ts index 8f4fe0f9044..15cfc6fbb12 100644 --- a/apps/server/src/modules/learnroom/service/group-deleted-handler.service.spec.ts +++ b/apps/server/src/modules/learnroom/service/group-deleted-handler.service.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ObjectId } from '@mikro-orm/mongodb'; import { GroupDeletedEvent } from '@modules/group'; import { Test, TestingModule } from '@nestjs/testing'; -import { groupFactory } from '@shared/testing'; +import { groupFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { Course } from '../domain'; import { courseFactory } from '../testing'; diff --git a/apps/server/src/modules/learnroom/testing/courseFactory.ts b/apps/server/src/modules/learnroom/testing/courseFactory.ts index 8f1f35e3dbe..1620e1fda0e 100644 --- a/apps/server/src/modules/learnroom/testing/courseFactory.ts +++ b/apps/server/src/modules/learnroom/testing/courseFactory.ts @@ -1,4 +1,4 @@ -import { DomainObjectFactory } from '@shared/testing'; +import { DomainObjectFactory } from '@shared/testing/factory'; import { ObjectId } from 'bson'; import { Course, CourseProps } from '../domain'; diff --git a/apps/server/src/modules/learnroom/uc/course-copy.uc.spec.ts b/apps/server/src/modules/learnroom/uc/course-copy.uc.spec.ts index 087104ac7af..1273a008e12 100644 --- a/apps/server/src/modules/learnroom/uc/course-copy.uc.spec.ts +++ b/apps/server/src/modules/learnroom/uc/course-copy.uc.spec.ts @@ -6,7 +6,7 @@ import { CopyElementType, CopyStatusEnum } from '@modules/copy-helper'; import { ForbiddenException, InternalServerErrorException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; -import { courseFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { CourseCopyService } from '../service'; import { CourseCopyUC } from './course-copy.uc'; diff --git a/apps/server/src/modules/learnroom/uc/course-import.uc.spec.ts b/apps/server/src/modules/learnroom/uc/course-import.uc.spec.ts index eedae71a09f..090813e30c6 100644 --- a/apps/server/src/modules/learnroom/uc/course-import.uc.spec.ts +++ b/apps/server/src/modules/learnroom/uc/course-import.uc.spec.ts @@ -5,7 +5,7 @@ import { NotFoundException } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; -import { courseFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { AuthorizationService } from '@src/modules/authorization'; import { LearnroomConfig } from '../learnroom.config'; import { CommonCartridgeImportService } from '../service'; diff --git a/apps/server/src/modules/learnroom/uc/course-sync.uc.spec.ts b/apps/server/src/modules/learnroom/uc/course-sync.uc.spec.ts index f9171895b9d..6a29868b74c 100644 --- a/apps/server/src/modules/learnroom/uc/course-sync.uc.spec.ts +++ b/apps/server/src/modules/learnroom/uc/course-sync.uc.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { AuthorizationContextBuilder, AuthorizationService } from '@modules/authorization'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { CourseDoService } from '../service'; import { courseFactory } from '../testing'; import { CourseSyncUc } from './course-sync.uc'; diff --git a/apps/server/src/modules/learnroom/uc/course.uc.spec.ts b/apps/server/src/modules/learnroom/uc/course.uc.spec.ts index 29b0a5be59b..2bf94594d6f 100644 --- a/apps/server/src/modules/learnroom/uc/course.uc.spec.ts +++ b/apps/server/src/modules/learnroom/uc/course.uc.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission, RoleName, SortOrder } from '@shared/domain/interface'; import { CourseRepo } from '@shared/repo'; -import { courseFactory, setupEntities, UserAndAccountTestFactory } from '@shared/testing'; +import { courseFactory, setupEntities, UserAndAccountTestFactory } from '@shared/testing/factory'; import { AuthorizationService } from '@src/modules/authorization'; import { RoleDto, RoleService } from '@src/modules/role'; import { CourseUc } from './course.uc'; diff --git a/apps/server/src/modules/learnroom/uc/lesson-copy.uc.spec.ts b/apps/server/src/modules/learnroom/uc/lesson-copy.uc.spec.ts index a24643a8183..d668b4b9009 100644 --- a/apps/server/src/modules/learnroom/uc/lesson-copy.uc.spec.ts +++ b/apps/server/src/modules/learnroom/uc/lesson-copy.uc.spec.ts @@ -8,7 +8,7 @@ import { ForbiddenException, InternalServerErrorException } from '@nestjs/common import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; import { CourseRepo, UserRepo } from '@shared/repo'; -import { courseFactory, lessonFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory, lessonFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { LessonCopyUC } from './lesson-copy.uc'; describe('lesson copy uc', () => { diff --git a/apps/server/src/modules/learnroom/uc/rooms.authorisation.service.spec.ts b/apps/server/src/modules/learnroom/uc/rooms.authorisation.service.spec.ts index b4c3145cb36..fce263e0512 100644 --- a/apps/server/src/modules/learnroom/uc/rooms.authorisation.service.spec.ts +++ b/apps/server/src/modules/learnroom/uc/rooms.authorisation.service.spec.ts @@ -1,6 +1,6 @@ import { NotImplementedException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { courseFactory, lessonFactory, setupEntities, taskFactory, userFactory } from '@shared/testing'; +import { courseFactory, lessonFactory, setupEntities, taskFactory, userFactory } from '@shared/testing/factory'; import { RoomsAuthorisationService } from './rooms.authorisation.service'; describe('rooms authorisation service', () => { diff --git a/apps/server/src/modules/learnroom/uc/rooms.uc.spec.ts b/apps/server/src/modules/learnroom/uc/rooms.uc.spec.ts index 0d3fee07c6b..e4b65e46ec0 100644 --- a/apps/server/src/modules/learnroom/uc/rooms.uc.spec.ts +++ b/apps/server/src/modules/learnroom/uc/rooms.uc.spec.ts @@ -2,7 +2,14 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ForbiddenException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { CourseRepo, LegacyBoardRepo, TaskRepo, UserRepo } from '@shared/repo'; -import { boardFactory, courseFactory, lessonFactory, setupEntities, taskFactory, userFactory } from '@shared/testing'; +import { + boardFactory, + courseFactory, + lessonFactory, + setupEntities, + taskFactory, + userFactory, +} from '@shared/testing/factory'; import { RoomsService } from '../service/rooms.service'; import { RoomBoardDTO } from '../types'; import { RoomBoardDTOFactory } from './room-board-dto.factory'; diff --git a/apps/server/src/modules/legacy-school/controller/api-test/school.administration.api.spec.ts b/apps/server/src/modules/legacy-school/controller/api-test/school.administration.api.spec.ts index ed3643eb9ae..7c588f932d5 100644 --- a/apps/server/src/modules/legacy-school/controller/api-test/school.administration.api.spec.ts +++ b/apps/server/src/modules/legacy-school/controller/api-test/school.administration.api.spec.ts @@ -2,7 +2,7 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { ExecutionContext, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { SchoolEntity } from '@shared/domain/entity'; -import { TestApiClient, federalStateFactory } from '@shared/testing'; +import { TestApiClient, federalStateFactory } from '@shared/testing/factory'; import { AdminApiServerTestModule } from '@src/modules/server/admin-api.server.module'; import { AuthGuard } from '@nestjs/passport'; import { AdminApiSchoolCreateResponseDto } from '../dto/response/admin-api-school-create.response.dto'; diff --git a/apps/server/src/modules/legacy-school/service/school-system-options.service.spec.ts b/apps/server/src/modules/legacy-school/service/school-system-options.service.spec.ts index 8bb85d487ab..f05d1a60e31 100644 --- a/apps/server/src/modules/legacy-school/service/school-system-options.service.spec.ts +++ b/apps/server/src/modules/legacy-school/service/school-system-options.service.spec.ts @@ -1,7 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; -import { schoolSystemOptionsFactory } from '@shared/testing'; +import { schoolSystemOptionsFactory } from '@shared/testing/factory'; import { SchoolSystemOptions, SchulConneXProvisioningOptions } from '../domain'; import { SchulConneXProvisioningOptionsInterface } from '../interface'; import { ProvisioningOptionsInvalidTypeLoggableException } from '../loggable'; diff --git a/apps/server/src/modules/legacy-school/service/schulconnex-provisioning-options-update.service.spec.ts b/apps/server/src/modules/legacy-school/service/schulconnex-provisioning-options-update.service.spec.ts index 746c27c5a3e..276c5edc025 100644 --- a/apps/server/src/modules/legacy-school/service/schulconnex-provisioning-options-update.service.spec.ts +++ b/apps/server/src/modules/legacy-school/service/schulconnex-provisioning-options-update.service.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Group, GroupService, GroupTypes } from '@modules/group'; import { Test, TestingModule } from '@nestjs/testing'; import { Page } from '@shared/domain/domainobject'; -import { groupFactory, schoolSystemOptionsFactory } from '@shared/testing'; +import { groupFactory, schoolSystemOptionsFactory } from '@shared/testing/factory'; import { SchoolSystemOptions, SchulConneXProvisioningOptions } from '../domain'; import { SchulconnexProvisioningOptionsUpdateService } from './schulconnex-provisioning-options-update.service'; diff --git a/apps/server/src/modules/legacy-school/service/validation/school-validation.service.spec.ts b/apps/server/src/modules/legacy-school/service/validation/school-validation.service.spec.ts index e6d56b75c6e..ae6bd3d8da3 100644 --- a/apps/server/src/modules/legacy-school/service/validation/school-validation.service.spec.ts +++ b/apps/server/src/modules/legacy-school/service/validation/school-validation.service.spec.ts @@ -3,7 +3,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { LegacySchoolDo } from '@shared/domain/domainobject'; import { LegacySchoolRepo } from '@shared/repo'; -import { legacySchoolDoFactory } from '@shared/testing'; +import { legacySchoolDoFactory } from '@shared/testing/factory'; import { SchoolNumberDuplicateLoggableException } from '../../loggable'; import { SchoolValidationService } from './school-validation.service'; diff --git a/apps/server/src/modules/legacy-school/uc/school-system-options.uc.spec.ts b/apps/server/src/modules/legacy-school/uc/school-system-options.uc.spec.ts index c235b96f77b..a6601d225c3 100644 --- a/apps/server/src/modules/legacy-school/uc/school-system-options.uc.spec.ts +++ b/apps/server/src/modules/legacy-school/uc/school-system-options.uc.spec.ts @@ -6,7 +6,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { NotFoundLoggableException } from '@shared/common/loggable-exception'; import { Permission } from '@shared/domain/interface'; import { SystemProvisioningStrategy } from '@shared/domain/interface/system-provisioning.strategy'; -import { schoolSystemOptionsFactory, setupEntities, systemFactory, userFactory } from '@shared/testing'; +import { schoolSystemOptionsFactory, setupEntities, systemFactory, userFactory } from '@shared/testing/factory'; import { AnyProvisioningOptions, SchoolSystemOptions, SchulConneXProvisioningOptions } from '../domain'; import { ProvisioningStrategyMissingLoggableException } from '../loggable'; import { ProvisioningOptionsUpdateService, SchoolSystemOptionsService } from '../service'; diff --git a/apps/server/src/modules/lesson/controller/api-test/lesson-list.api.spec.ts b/apps/server/src/modules/lesson/controller/api-test/lesson-list.api.spec.ts index 0caf82fe949..4a811aff655 100644 --- a/apps/server/src/modules/lesson/controller/api-test/lesson-list.api.spec.ts +++ b/apps/server/src/modules/lesson/controller/api-test/lesson-list.api.spec.ts @@ -2,7 +2,7 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { ServerTestModule } from '@modules/server'; import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { TestApiClient, UserAndAccountTestFactory, courseFactory, lessonFactory } from '@shared/testing'; +import { TestApiClient, UserAndAccountTestFactory, courseFactory, lessonFactory } from '@shared/testing/factory'; import { LessonMetadataListResponse } from '../dto'; describe('Lesson Controller (API) - GET list of lessons from course /lessons/course/:courseId', () => { diff --git a/apps/server/src/modules/lesson/repository/lesson.repo.integration.spec.ts b/apps/server/src/modules/lesson/repository/lesson.repo.integration.spec.ts index 3a5d979aa95..b3583a8e35b 100644 --- a/apps/server/src/modules/lesson/repository/lesson.repo.integration.spec.ts +++ b/apps/server/src/modules/lesson/repository/lesson.repo.integration.spec.ts @@ -1,7 +1,13 @@ import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { ComponentProperties, ComponentType, LessonEntity } from '@shared/domain/entity'; -import { cleanupCollections, courseFactory, lessonFactory, materialFactory, taskFactory } from '@shared/testing'; +import { + cleanupCollections, + courseFactory, + lessonFactory, + materialFactory, + taskFactory, +} from '@shared/testing/factory'; import { MongoMemoryDatabaseModule } from '@infra/database'; diff --git a/apps/server/src/modules/lesson/uc/lesson.uc.spec.ts b/apps/server/src/modules/lesson/uc/lesson.uc.spec.ts index 12083aa3291..b9f57c9de4f 100644 --- a/apps/server/src/modules/lesson/uc/lesson.uc.spec.ts +++ b/apps/server/src/modules/lesson/uc/lesson.uc.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { AuthorizationContextBuilder, AuthorizationService } from '@modules/authorization'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; -import { courseFactory, lessonFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory, lessonFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { CourseService } from '@modules/learnroom/service'; import { LessonService } from '../service'; import { LessonUC } from './lesson.uc'; diff --git a/apps/server/src/modules/lti-tool/service/lti-tool.service.spec.ts b/apps/server/src/modules/lti-tool/service/lti-tool.service.spec.ts index dc3a44e280c..47ce3b75827 100644 --- a/apps/server/src/modules/lti-tool/service/lti-tool.service.spec.ts +++ b/apps/server/src/modules/lti-tool/service/lti-tool.service.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; import { LtiToolDO } from '@shared/domain/domainobject'; import { LtiToolRepo } from '@shared/repo'; -import { ltiToolDOFactory } from '@shared/testing'; +import { ltiToolDOFactory } from '@shared/testing/factory'; import { LtiToolService } from './lti-tool.service'; describe('LtiToolService', () => { diff --git a/apps/server/src/modules/management/seed-data/roles.ts b/apps/server/src/modules/management/seed-data/roles.ts index 1484c9d8d58..79e074611ed 100644 --- a/apps/server/src/modules/management/seed-data/roles.ts +++ b/apps/server/src/modules/management/seed-data/roles.ts @@ -2,7 +2,7 @@ import { Role, RoleProperties } from '@shared/domain/entity'; import { Permission, RoleName } from '@shared/domain/interface'; -import { roleFactory } from '@shared/testing'; +import { roleFactory } from '@shared/testing/factory'; import { DeepPartial } from 'fishery'; type SeedRoleProperties = Omit & { diff --git a/apps/server/src/modules/management/seed-data/schools.ts b/apps/server/src/modules/management/seed-data/schools.ts index 42f74aa90ac..2330e78e5e2 100644 --- a/apps/server/src/modules/management/seed-data/schools.ts +++ b/apps/server/src/modules/management/seed-data/schools.ts @@ -8,7 +8,7 @@ import { } from '@shared/domain/entity'; import { LanguageType } from '@shared/domain/interface'; import { SchoolFeature, SchoolPurpose } from '@shared/domain/types'; -import { federalStateFactory, schoolEntityFactory } from '@shared/testing'; +import { federalStateFactory, schoolEntityFactory } from '@shared/testing/factory'; import { FileStorageType } from '@src/modules/school/domain/type/file-storage-type.enum'; import { ObjectId } from '@mikro-orm/mongodb'; import { DeepPartial } from 'fishery'; diff --git a/apps/server/src/modules/management/seed-data/systems.ts b/apps/server/src/modules/management/seed-data/systems.ts index 15b4e6a9306..0fce371642d 100644 --- a/apps/server/src/modules/management/seed-data/systems.ts +++ b/apps/server/src/modules/management/seed-data/systems.ts @@ -1,7 +1,7 @@ /* eslint-disable no-template-curly-in-string */ import { SystemEntityProps } from '@shared/domain/entity'; import { SystemProvisioningStrategy } from '@shared/domain/interface/system-provisioning.strategy'; -import { systemEntityFactory } from '@shared/testing'; +import { systemEntityFactory } from '@shared/testing/factory'; import { DeepPartial } from 'fishery'; type SystemPartial = DeepPartial & { diff --git a/apps/server/src/modules/me/api/test/me.controller.api.spec.ts b/apps/server/src/modules/me/api/test/me.controller.api.spec.ts index dbfe283ca06..3b358de93b4 100644 --- a/apps/server/src/modules/me/api/test/me.controller.api.spec.ts +++ b/apps/server/src/modules/me/api/test/me.controller.api.spec.ts @@ -3,7 +3,7 @@ import { AccountEntity } from '@src/modules/account/domain/entity/account.entity import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import type { User } from '@shared/domain/entity'; -import { schoolEntityFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; +import { schoolEntityFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing/factory'; import { ServerTestModule } from '@src/modules/server'; import { MeResponse } from '../dto'; diff --git a/apps/server/src/modules/meta-tag-extractor/controller/api-test/meta-tag-extractor-get-data.api.spec.ts b/apps/server/src/modules/meta-tag-extractor/controller/api-test/meta-tag-extractor-get-data.api.spec.ts index 2a6c2a93d90..2d9a57aa8d0 100644 --- a/apps/server/src/modules/meta-tag-extractor/controller/api-test/meta-tag-extractor-get-data.api.spec.ts +++ b/apps/server/src/modules/meta-tag-extractor/controller/api-test/meta-tag-extractor-get-data.api.spec.ts @@ -2,7 +2,7 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { ServerTestModule } from '@modules/server/server.module'; import { INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; +import { TestApiClient, UserAndAccountTestFactory } from '@shared/testing/factory'; import { MetaTagExtractorService } from '../../service'; const URL = 'https://best-example.de/my-article'; diff --git a/apps/server/src/modules/meta-tag-extractor/uc/meta-tag-extractor.uc.spec.ts b/apps/server/src/modules/meta-tag-extractor/uc/meta-tag-extractor.uc.spec.ts index f5aa0c6cd72..343a0769142 100644 --- a/apps/server/src/modules/meta-tag-extractor/uc/meta-tag-extractor.uc.spec.ts +++ b/apps/server/src/modules/meta-tag-extractor/uc/meta-tag-extractor.uc.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { AuthorizationService } from '@modules/authorization'; import { UnauthorizedException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { MetaTagExtractorService } from '../service'; import { MetaTagExtractorUc } from './meta-tag-extractor.uc'; diff --git a/apps/server/src/modules/news/mapper/news.mapper.spec.ts b/apps/server/src/modules/news/mapper/news.mapper.spec.ts index de81fae7dcd..8449b773f5c 100644 --- a/apps/server/src/modules/news/mapper/news.mapper.spec.ts +++ b/apps/server/src/modules/news/mapper/news.mapper.spec.ts @@ -10,7 +10,7 @@ import { User, } from '@shared/domain/entity'; import { CreateNews, INewsScope, IUpdateNews, NewsTarget, NewsTargetModel } from '@shared/domain/types'; -import { courseFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { CreateNewsParams, FilterNewsParams, diff --git a/apps/server/src/modules/news/service/news.service.spec.ts b/apps/server/src/modules/news/service/news.service.spec.ts index 4e5fe11c67a..51eb608f9b2 100644 --- a/apps/server/src/modules/news/service/news.service.spec.ts +++ b/apps/server/src/modules/news/service/news.service.spec.ts @@ -1,7 +1,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { createMock, DeepMocked } from '@golevelup/ts-jest'; -import { setupEntities, teamNewsFactory, userFactory } from '@shared/testing'; +import { setupEntities, teamNewsFactory, userFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { NewsRepo } from '@shared/repo'; import { EventBus } from '@nestjs/cqrs'; diff --git a/apps/server/src/modules/oauth-provider/service/id-token.service.spec.ts b/apps/server/src/modules/oauth-provider/service/id-token.service.spec.ts index 4a58a3e8336..099b937514c 100644 --- a/apps/server/src/modules/oauth-provider/service/id-token.service.spec.ts +++ b/apps/server/src/modules/oauth-provider/service/id-token.service.spec.ts @@ -9,7 +9,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Pseudonym, UserDO } from '@shared/domain/domainobject'; import { TeamEntity } from '@shared/domain/entity'; import { TeamsRepo } from '@shared/repo'; -import { externalToolFactory, pseudonymFactory, setupEntities, userDoFactory } from '@shared/testing'; +import { externalToolFactory, pseudonymFactory, setupEntities, userDoFactory } from '@shared/testing/factory'; import { teamFactory } from '@shared/testing/factory/team.factory'; import { IdTokenCreationLoggableException } from '../error/id-token-creation-exception.loggable'; import { OauthProviderLoginFlowService } from './oauth-provider.login-flow.service'; diff --git a/apps/server/src/modules/oauth-provider/uc/oauth-provider.client-crud.uc.spec.ts b/apps/server/src/modules/oauth-provider/uc/oauth-provider.client-crud.uc.spec.ts index 99be39f54de..55c828bfab1 100644 --- a/apps/server/src/modules/oauth-provider/uc/oauth-provider.client-crud.uc.spec.ts +++ b/apps/server/src/modules/oauth-provider/uc/oauth-provider.client-crud.uc.spec.ts @@ -7,7 +7,7 @@ import { UnauthorizedException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { OauthProviderClientCrudUc } from './oauth-provider.client-crud.uc'; import resetAllMocks = jest.resetAllMocks; diff --git a/apps/server/src/modules/oauth/service/hydra.service.spec.ts b/apps/server/src/modules/oauth/service/hydra.service.spec.ts index 9874bbb22da..b5d9d4d513a 100644 --- a/apps/server/src/modules/oauth/service/hydra.service.spec.ts +++ b/apps/server/src/modules/oauth/service/hydra.service.spec.ts @@ -11,7 +11,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { LtiToolDO } from '@shared/domain/domainobject/ltitool.do'; import { LtiPrivacyPermission, LtiRoleType, OauthConfigEntity } from '@shared/domain/entity'; import { LtiToolRepo } from '@shared/repo'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { AxiosResponse } from 'axios'; import { of } from 'rxjs'; diff --git a/apps/server/src/modules/oauth/service/oauth-adapter.service.spec.ts b/apps/server/src/modules/oauth/service/oauth-adapter.service.spec.ts index 63319b859d4..4fdd3f14079 100644 --- a/apps/server/src/modules/oauth/service/oauth-adapter.service.spec.ts +++ b/apps/server/src/modules/oauth/service/oauth-adapter.service.spec.ts @@ -1,8 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { HttpService } from '@nestjs/axios'; import { Test, TestingModule } from '@nestjs/testing'; -import { axiosResponseFactory } from '@shared/testing'; -import { axiosErrorFactory } from '@shared/testing/factory'; +import { axiosResponseFactory, axiosErrorFactory } from '@shared/testing/factory'; import { AxiosError } from 'axios'; import { of, throwError } from 'rxjs'; import { OAuthTokenDto } from '../interface'; diff --git a/apps/server/src/modules/oauth/service/oauth.service.spec.ts b/apps/server/src/modules/oauth/service/oauth.service.spec.ts index de9246db5e7..8795a2f3c16 100644 --- a/apps/server/src/modules/oauth/service/oauth.service.spec.ts +++ b/apps/server/src/modules/oauth/service/oauth.service.spec.ts @@ -13,7 +13,7 @@ import { LegacySchoolDo, UserDO } from '@shared/domain/domainobject'; import { OauthConfigEntity, SystemEntity } from '@shared/domain/entity'; import { SystemProvisioningStrategy } from '@shared/domain/interface/system-provisioning.strategy'; import { SchoolFeature } from '@shared/domain/types'; -import { legacySchoolDoFactory, setupEntities, systemEntityFactory, userDoFactory } from '@shared/testing'; +import { legacySchoolDoFactory, setupEntities, systemEntityFactory, userDoFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { OauthDataDto } from '@src/modules/provisioning/dto'; import { LegacySystemService } from '@src/modules/system'; diff --git a/apps/server/src/modules/oauth/uc/hydra-oauth.uc.spec.ts b/apps/server/src/modules/oauth/uc/hydra-oauth.uc.spec.ts index efaf7190329..084988fe0be 100644 --- a/apps/server/src/modules/oauth/uc/hydra-oauth.uc.spec.ts +++ b/apps/server/src/modules/oauth/uc/hydra-oauth.uc.spec.ts @@ -6,7 +6,7 @@ import { HttpModule } from '@nestjs/axios'; import { InternalServerErrorException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { OauthConfigEntity } from '@shared/domain/entity'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { AxiosResponse } from 'axios'; import { HydraOauthUc } from '.'; diff --git a/apps/server/src/modules/provisioning/loggable/school-for-group-not-found.loggable.spec.ts b/apps/server/src/modules/provisioning/loggable/school-for-group-not-found.loggable.spec.ts index 888a6a58514..0b51c8febfd 100644 --- a/apps/server/src/modules/provisioning/loggable/school-for-group-not-found.loggable.spec.ts +++ b/apps/server/src/modules/provisioning/loggable/school-for-group-not-found.loggable.spec.ts @@ -1,4 +1,4 @@ -import { externalSchoolDtoFactory } from '@shared/testing'; +import { externalSchoolDtoFactory } from '@shared/testing/factory'; import { externalGroupDtoFactory } from '@shared/testing/factory/external-group-dto.factory'; import { ExternalGroupDto, ExternalSchoolDto } from '../dto'; import { SchoolForGroupNotFoundLoggable } from './school-for-group-not-found.loggable'; diff --git a/apps/server/src/modules/provisioning/strategy/iserv/iserv.strategy.spec.ts b/apps/server/src/modules/provisioning/strategy/iserv/iserv.strategy.spec.ts index 47068ab32e2..4ae8fb3bee4 100644 --- a/apps/server/src/modules/provisioning/strategy/iserv/iserv.strategy.spec.ts +++ b/apps/server/src/modules/provisioning/strategy/iserv/iserv.strategy.spec.ts @@ -6,7 +6,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { LegacySchoolDo, UserDO } from '@shared/domain/domainobject'; import { RoleName } from '@shared/domain/interface'; import { SystemProvisioningStrategy } from '@shared/domain/interface/system-provisioning.strategy'; -import { legacySchoolDoFactory, userDoFactory } from '@shared/testing'; +import { legacySchoolDoFactory, userDoFactory } from '@shared/testing/factory'; import { IdTokenExtractionFailureLoggableException, IdTokenUserNotFoundLoggableException, diff --git a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.spec.ts b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.spec.ts index a662a5d5502..a48866e7b7e 100644 --- a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.spec.ts +++ b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-course-sync.service.spec.ts @@ -6,7 +6,7 @@ import { CourseDoService } from '@modules/learnroom/service/course-do.service'; import { courseFactory } from '@modules/learnroom/testing'; import { RoleDto, RoleService } from '@modules/role'; import { Test, TestingModule } from '@nestjs/testing'; -import { groupFactory, roleDtoFactory } from '@shared/testing'; +import { groupFactory, roleDtoFactory } from '@shared/testing/factory'; import { SchulconnexCourseSyncService } from './schulconnex-course-sync.service'; describe(SchulconnexCourseSyncService.name, () => { diff --git a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-license-provisioning.service.spec.ts b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-license-provisioning.service.spec.ts index 760703f6aba..16a93401ef7 100644 --- a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-license-provisioning.service.spec.ts +++ b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-license-provisioning.service.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { MediaUserLicense, mediaUserLicenseFactory, UserLicenseService, UserLicenseType } from '@modules/user-license'; import { Test, TestingModule } from '@nestjs/testing'; import { User as UserEntity } from '@shared/domain/entity'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { ExternalLicenseDto } from '../../../dto'; import { SchulconnexLicenseProvisioningService } from './schulconnex-license-provisioning.service'; diff --git a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-school-provisioning.service.spec.ts b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-school-provisioning.service.spec.ts index 31c41b8ee1a..fb329d04fb4 100644 --- a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-school-provisioning.service.spec.ts +++ b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-school-provisioning.service.spec.ts @@ -4,7 +4,7 @@ import { FederalStateService, LegacySchoolService, SchoolYearService } from '@mo import { Test, TestingModule } from '@nestjs/testing'; import { LegacySchoolDo } from '@shared/domain/domainobject'; import { SchoolFeature } from '@shared/domain/types'; -import { federalStateFactory, legacySchoolDoFactory, schoolYearFactory } from '@shared/testing'; +import { federalStateFactory, legacySchoolDoFactory, schoolYearFactory } from '@shared/testing/factory'; import { ExternalSchoolDto } from '../../../dto'; import { SchulconnexSchoolProvisioningService } from './schulconnex-school-provisioning.service'; diff --git a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-user-provisioning.service.spec.ts b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-user-provisioning.service.spec.ts index 08f3f70bb38..4366bf79705 100644 --- a/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-user-provisioning.service.spec.ts +++ b/apps/server/src/modules/provisioning/strategy/oidc/service/schulconnex-user-provisioning.service.spec.ts @@ -7,7 +7,7 @@ import { UnprocessableEntityException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { UserDO } from '@shared/domain/domainobject'; import { RoleName } from '@shared/domain/interface'; -import { userDoFactory } from '@shared/testing'; +import { userDoFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import CryptoJS from 'crypto-js'; import { ExternalUserDto } from '../../../dto'; diff --git a/apps/server/src/modules/provisioning/strategy/sanis/sanis.strategy.spec.ts b/apps/server/src/modules/provisioning/strategy/sanis/sanis.strategy.spec.ts index 4fc0c390535..4d919cef625 100644 --- a/apps/server/src/modules/provisioning/strategy/sanis/sanis.strategy.spec.ts +++ b/apps/server/src/modules/provisioning/strategy/sanis/sanis.strategy.spec.ts @@ -17,7 +17,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { ValidationErrorLoggableException } from '@shared/common/loggable-exception'; import { RoleName } from '@shared/domain/interface'; import { SystemProvisioningStrategy } from '@shared/domain/interface/system-provisioning.strategy'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import * as classValidator from 'class-validator'; import { of } from 'rxjs'; import { IProvisioningFeatures, ProvisioningFeatures } from '../../config'; diff --git a/apps/server/src/modules/pseudonym/repo/external-tool-pseudonym.repo.integration.spec.ts b/apps/server/src/modules/pseudonym/repo/external-tool-pseudonym.repo.integration.spec.ts index bfd074b2599..83230ee9f0b 100644 --- a/apps/server/src/modules/pseudonym/repo/external-tool-pseudonym.repo.integration.spec.ts +++ b/apps/server/src/modules/pseudonym/repo/external-tool-pseudonym.repo.integration.spec.ts @@ -5,7 +5,12 @@ import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { Page, Pseudonym } from '@shared/domain/domainobject'; -import { cleanupCollections, externalToolPseudonymEntityFactory, pseudonymFactory, userFactory } from '@shared/testing'; +import { + cleanupCollections, + externalToolPseudonymEntityFactory, + pseudonymFactory, + userFactory, +} from '@shared/testing/factory'; import { pseudonymEntityFactory } from '@shared/testing/factory/pseudonym.factory'; import { LegacyLogger } from '@src/core/logger'; import { v4 as uuidv4 } from 'uuid'; diff --git a/apps/server/src/modules/pseudonym/repo/pseudonyms.repo.spec.ts b/apps/server/src/modules/pseudonym/repo/pseudonyms.repo.spec.ts index 404ada59a66..e5e4b266078 100644 --- a/apps/server/src/modules/pseudonym/repo/pseudonyms.repo.spec.ts +++ b/apps/server/src/modules/pseudonym/repo/pseudonyms.repo.spec.ts @@ -4,7 +4,7 @@ import { NotFoundError } from '@mikro-orm/core'; import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { Pseudonym } from '@shared/domain/domainobject'; -import { cleanupCollections, pseudonymFactory, userFactory } from '@shared/testing'; +import { cleanupCollections, pseudonymFactory, userFactory } from '@shared/testing/factory'; import { pseudonymEntityFactory } from '@shared/testing/factory/pseudonym.factory'; import { LegacyLogger } from '@src/core/logger'; import { v4 as uuidv4 } from 'uuid'; diff --git a/apps/server/src/modules/registration-pin/entity/testing/factory/registration-pin.entity.factory.ts b/apps/server/src/modules/registration-pin/entity/testing/factory/registration-pin.entity.factory.ts index 9a162147bed..585d611919d 100644 --- a/apps/server/src/modules/registration-pin/entity/testing/factory/registration-pin.entity.factory.ts +++ b/apps/server/src/modules/registration-pin/entity/testing/factory/registration-pin.entity.factory.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { RegistrationPinEntity, RegistrationPinEntityProps } from '../../registration-pin.entity'; export const registrationPinEntityFactory = BaseFactory.define( diff --git a/apps/server/src/modules/registration-pin/repo/registration-pin.repo.spec.ts b/apps/server/src/modules/registration-pin/repo/registration-pin.repo.spec.ts index a91a6801db3..b89ebc20eb9 100644 --- a/apps/server/src/modules/registration-pin/repo/registration-pin.repo.spec.ts +++ b/apps/server/src/modules/registration-pin/repo/registration-pin.repo.spec.ts @@ -1,7 +1,7 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { MongoMemoryDatabaseModule } from '@infra/database'; -import { cleanupCollections, userFactory } from '@shared/testing'; +import { cleanupCollections, userFactory } from '@shared/testing/factory'; import { RegistrationPinRepo } from '.'; import { registrationPinEntityFactory } from '../entity/testing'; diff --git a/apps/server/src/modules/registration-pin/service/registration-pin.service.spec.ts b/apps/server/src/modules/registration-pin/service/registration-pin.service.spec.ts index 523f821000f..aec54e1dda8 100644 --- a/apps/server/src/modules/registration-pin/service/registration-pin.service.spec.ts +++ b/apps/server/src/modules/registration-pin/service/registration-pin.service.spec.ts @@ -1,6 +1,6 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; -import { setupEntities, userDoFactory } from '@shared/testing'; +import { setupEntities, userDoFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { DomainDeletionReportBuilder, diff --git a/apps/server/src/modules/rocketchat-user/domain/testing/rocket-chat-user.factory.ts b/apps/server/src/modules/rocketchat-user/domain/testing/rocket-chat-user.factory.ts index 3ad6432d1d5..6cac22a68b2 100644 --- a/apps/server/src/modules/rocketchat-user/domain/testing/rocket-chat-user.factory.ts +++ b/apps/server/src/modules/rocketchat-user/domain/testing/rocket-chat-user.factory.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { RocketChatUser, RocketChatUserProps } from '../rocket-chat-user.do'; export const rocketChatUserFactory = BaseFactory.define( diff --git a/apps/server/src/modules/rocketchat-user/entity/testing/rocket-chat-user.entity.factory.ts b/apps/server/src/modules/rocketchat-user/entity/testing/rocket-chat-user.entity.factory.ts index 302459a4eb6..fdf61508747 100644 --- a/apps/server/src/modules/rocketchat-user/entity/testing/rocket-chat-user.entity.factory.ts +++ b/apps/server/src/modules/rocketchat-user/entity/testing/rocket-chat-user.entity.factory.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { RocketChatUserEntity, RocketChatUserEntityProps } from '../rocket-chat-user.entity'; class RocketChatUserFactory extends BaseFactory {} diff --git a/apps/server/src/modules/role/service/role.service.spec.ts b/apps/server/src/modules/role/service/role.service.spec.ts index c088fadaf0b..fec9ddd74b7 100644 --- a/apps/server/src/modules/role/service/role.service.spec.ts +++ b/apps/server/src/modules/role/service/role.service.spec.ts @@ -4,7 +4,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Role } from '@shared/domain/entity'; import { RoleName } from '@shared/domain/interface'; import { RoleRepo } from '@shared/repo'; -import { roleFactory } from '@shared/testing'; +import { roleFactory } from '@shared/testing/factory'; import { RoleDto } from './dto'; import { RoleService } from './role.service'; diff --git a/apps/server/src/modules/school/domain/service/school.service.spec.ts b/apps/server/src/modules/school/domain/service/school.service.spec.ts index 8c2ecbd0e6d..ede2aab2f3e 100644 --- a/apps/server/src/modules/school/domain/service/school.service.spec.ts +++ b/apps/server/src/modules/school/domain/service/school.service.spec.ts @@ -3,7 +3,7 @@ import { NotFoundException } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { Test, TestingModule } from '@nestjs/testing'; import { IFindOptions, SortOrder } from '@shared/domain/interface'; -import { systemFactory } from '@shared/testing'; +import { systemFactory } from '@shared/testing/factory'; import { SystemService } from '@src/modules/system'; import { schoolFactory } from '../../testing'; import { SchoolForLdapLogin, SchoolProps, SystemForLdapLogin } from '../do'; diff --git a/apps/server/src/modules/school/repo/mikro-orm/school-year.repo.integration.spec.ts b/apps/server/src/modules/school/repo/mikro-orm/school-year.repo.integration.spec.ts index eecb36bb3fe..b4d4cbaad0e 100644 --- a/apps/server/src/modules/school/repo/mikro-orm/school-year.repo.integration.spec.ts +++ b/apps/server/src/modules/school/repo/mikro-orm/school-year.repo.integration.spec.ts @@ -1,7 +1,7 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { SchoolYearEntity } from '@shared/domain/entity/schoolyear.entity'; -import { cleanupCollections, schoolYearFactory } from '@shared/testing'; +import { cleanupCollections, schoolYearFactory } from '@shared/testing/factory'; import { MongoMemoryDatabaseModule } from '@src/infra/database'; import { SCHOOL_YEAR_REPO } from '../../domain'; import { SchoolYearEntityMapper } from './mapper'; diff --git a/apps/server/src/modules/school/testing/county.factory.ts b/apps/server/src/modules/school/testing/county.factory.ts index b7ea95b66d6..943e95cf568 100644 --- a/apps/server/src/modules/school/testing/county.factory.ts +++ b/apps/server/src/modules/school/testing/county.factory.ts @@ -1,4 +1,4 @@ -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { County, CountyProps } from '../domain'; diff --git a/apps/server/src/modules/school/testing/federal-state.factory.ts b/apps/server/src/modules/school/testing/federal-state.factory.ts index 884c61905c0..d099c09dbd5 100644 --- a/apps/server/src/modules/school/testing/federal-state.factory.ts +++ b/apps/server/src/modules/school/testing/federal-state.factory.ts @@ -1,4 +1,4 @@ -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { FederalState, FederalStateProps } from '../domain'; import { countyFactory } from './county.factory'; diff --git a/apps/server/src/modules/school/testing/school-year.factory.ts b/apps/server/src/modules/school/testing/school-year.factory.ts index e32f61c191a..f706f707042 100644 --- a/apps/server/src/modules/school/testing/school-year.factory.ts +++ b/apps/server/src/modules/school/testing/school-year.factory.ts @@ -1,4 +1,4 @@ -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { SchoolYear, SchoolYearProps } from '../domain'; diff --git a/apps/server/src/modules/school/testing/school.factory.ts b/apps/server/src/modules/school/testing/school.factory.ts index ccb05fde5ee..d48e20c0aef 100644 --- a/apps/server/src/modules/school/testing/school.factory.ts +++ b/apps/server/src/modules/school/testing/school.factory.ts @@ -1,5 +1,5 @@ import { SchoolFeature } from '@shared/domain/types'; -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { School, SchoolProps } from '../domain'; import { federalStateFactory } from './federal-state.factory'; diff --git a/apps/server/src/modules/sharing/controller/api-test/sharing-lookup-token.api.spec.ts b/apps/server/src/modules/sharing/controller/api-test/sharing-lookup-token.api.spec.ts index 57498162304..fda8719e2a9 100644 --- a/apps/server/src/modules/sharing/controller/api-test/sharing-lookup-token.api.spec.ts +++ b/apps/server/src/modules/sharing/controller/api-test/sharing-lookup-token.api.spec.ts @@ -4,7 +4,7 @@ import { ServerTestModule } from '@modules/server'; import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; -import { courseFactory, schoolEntityFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; +import { courseFactory, schoolEntityFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing/factory'; import { ShareTokenContextType, ShareTokenParentType } from '../../domainobject/share-token.do'; import { ShareTokenService } from '../../service'; import { ShareTokenInfoResponse } from '../dto'; diff --git a/apps/server/src/modules/sharing/controller/share-token.controller.spec.ts b/apps/server/src/modules/sharing/controller/share-token.controller.spec.ts index d37b8b435ff..997b0640af7 100644 --- a/apps/server/src/modules/sharing/controller/share-token.controller.spec.ts +++ b/apps/server/src/modules/sharing/controller/share-token.controller.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ICurrentUser } from '@modules/authentication'; import { CopyElementType, CopyStatus, CopyStatusEnum } from '@modules/copy-helper'; import { Test, TestingModule } from '@nestjs/testing'; -import { courseFactory, setupEntities, shareTokenFactory } from '@shared/testing'; +import { courseFactory, setupEntities, shareTokenFactory } from '@shared/testing/factory'; import { ShareTokenParentType } from '../domainobject/share-token.do'; import { ShareTokenUC } from '../uc'; import { ShareTokenInfoDto } from '../uc/dto'; diff --git a/apps/server/src/modules/sharing/repo/share-token.repo.integration.spec.ts b/apps/server/src/modules/sharing/repo/share-token.repo.integration.spec.ts index dc0f03f1d49..54585f7e34f 100644 --- a/apps/server/src/modules/sharing/repo/share-token.repo.integration.spec.ts +++ b/apps/server/src/modules/sharing/repo/share-token.repo.integration.spec.ts @@ -2,7 +2,7 @@ import { createMock } from '@golevelup/ts-jest'; import { MongoMemoryDatabaseModule } from '@infra/database'; import { EntityManager } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; -import { cleanupCollections, schoolEntityFactory, shareTokenFactory } from '@shared/testing'; +import { cleanupCollections, schoolEntityFactory, shareTokenFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { ShareTokenContextType } from '../domainobject/share-token.do'; import { ShareTokenRepo } from './share-token.repo'; diff --git a/apps/server/src/modules/synchronization/domain/testing/factory/synchronization.factory.ts b/apps/server/src/modules/synchronization/domain/testing/factory/synchronization.factory.ts index 4d8c7e1ee91..71e29e60aff 100644 --- a/apps/server/src/modules/synchronization/domain/testing/factory/synchronization.factory.ts +++ b/apps/server/src/modules/synchronization/domain/testing/factory/synchronization.factory.ts @@ -1,4 +1,4 @@ -import { DoBaseFactory } from '@shared/testing'; +import { DoBaseFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { Synchronization, SynchronizationProps } from '../../do'; import { SynchronizationStatusModel } from '../../types'; diff --git a/apps/server/src/modules/synchronization/repo/entity/testing/factory/synchronization.entity.factory.ts b/apps/server/src/modules/synchronization/repo/entity/testing/factory/synchronization.entity.factory.ts index 8f006080da5..95f6fbbbeeb 100644 --- a/apps/server/src/modules/synchronization/repo/entity/testing/factory/synchronization.entity.factory.ts +++ b/apps/server/src/modules/synchronization/repo/entity/testing/factory/synchronization.entity.factory.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { SynchronizationEntity, SynchronizationEntityProps } from '../../synchronization.entity'; import { SynchronizationStatusModel } from '../../../../domain/types'; diff --git a/apps/server/src/modules/system/controller/api-test/system.api.spec.ts b/apps/server/src/modules/system/controller/api-test/system.api.spec.ts index 4aaf7fff046..f017f074fe6 100644 --- a/apps/server/src/modules/system/controller/api-test/system.api.spec.ts +++ b/apps/server/src/modules/system/controller/api-test/system.api.spec.ts @@ -3,7 +3,12 @@ import { ServerTestModule } from '@modules/server'; import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { OauthConfigEntity, SchoolEntity, SystemEntity } from '@shared/domain/entity'; -import { schoolEntityFactory, systemEntityFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; +import { + schoolEntityFactory, + systemEntityFactory, + TestApiClient, + UserAndAccountTestFactory, +} from '@shared/testing/factory'; import { Response } from 'supertest'; import { PublicSystemListResponse, PublicSystemResponse } from '../dto'; diff --git a/apps/server/src/modules/system/domain/system.do.spec.ts b/apps/server/src/modules/system/domain/system.do.spec.ts index 9d5f9dc5a08..45d9deec4ab 100644 --- a/apps/server/src/modules/system/domain/system.do.spec.ts +++ b/apps/server/src/modules/system/domain/system.do.spec.ts @@ -1,4 +1,4 @@ -import { systemFactory } from '@shared/testing'; +import { systemFactory } from '@shared/testing/factory'; describe('System', () => { describe('isDeletable', () => { diff --git a/apps/server/src/modules/system/mapper/system-oidc.mapper.spec.ts b/apps/server/src/modules/system/mapper/system-oidc.mapper.spec.ts index 49c78b4dc2f..828649bc6d7 100644 --- a/apps/server/src/modules/system/mapper/system-oidc.mapper.spec.ts +++ b/apps/server/src/modules/system/mapper/system-oidc.mapper.spec.ts @@ -1,6 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { SystemEntity } from '@shared/domain/entity'; -import { systemEntityFactory } from '@shared/testing'; +import { systemEntityFactory } from '@shared/testing/factory'; import { SystemOidcMapper } from './system-oidc.mapper'; describe('SystemOidcMapper', () => { diff --git a/apps/server/src/modules/system/mapper/system.mapper.spec.ts b/apps/server/src/modules/system/mapper/system.mapper.spec.ts index 02af426d04c..f60674bae2b 100644 --- a/apps/server/src/modules/system/mapper/system.mapper.spec.ts +++ b/apps/server/src/modules/system/mapper/system.mapper.spec.ts @@ -1,6 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { SystemEntity } from '@shared/domain/entity'; -import { systemEntityFactory } from '@shared/testing'; +import { systemEntityFactory } from '@shared/testing/factory'; import { SystemMapper } from './system.mapper'; describe('SystemMapper', () => { diff --git a/apps/server/src/modules/system/repo/mikro-orm/system.repo.spec.ts b/apps/server/src/modules/system/repo/mikro-orm/system.repo.spec.ts index 157930f04fe..1c8d2bee68b 100644 --- a/apps/server/src/modules/system/repo/mikro-orm/system.repo.spec.ts +++ b/apps/server/src/modules/system/repo/mikro-orm/system.repo.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { LdapConfigEntity, OauthConfigEntity, SystemEntity } from '@shared/domain/entity'; import { SystemProvisioningStrategy } from '@shared/domain/interface/system-provisioning.strategy'; import { SystemTypeEnum } from '@shared/domain/types'; -import { cleanupCollections, systemEntityFactory } from '@shared/testing'; +import { cleanupCollections, systemEntityFactory } from '@shared/testing/factory'; import { SYSTEM_REPO, System, SystemProps, SystemRepo } from '../../domain'; import { SystemEntityMapper } from './mapper/system-entity.mapper'; import { SystemMikroOrmRepo } from './system.repo'; diff --git a/apps/server/src/modules/system/service/legacy-system.service.spec.ts b/apps/server/src/modules/system/service/legacy-system.service.spec.ts index c1528da8ead..13d5140dcc6 100644 --- a/apps/server/src/modules/system/service/legacy-system.service.spec.ts +++ b/apps/server/src/modules/system/service/legacy-system.service.spec.ts @@ -5,7 +5,7 @@ import { EntityNotFoundError } from '@shared/common'; import { OauthConfigEntity, SystemEntity } from '@shared/domain/entity'; import { SystemTypeEnum } from '@shared/domain/types'; import { LegacySystemRepo } from '@shared/repo'; -import { systemEntityFactory } from '@shared/testing'; +import { systemEntityFactory } from '@shared/testing/factory'; import { SystemMapper } from '../mapper'; import { LegacySystemService } from './legacy-system.service'; diff --git a/apps/server/src/modules/system/service/system-oidc.service.spec.ts b/apps/server/src/modules/system/service/system-oidc.service.spec.ts index 6c20f4c7958..61de37575dd 100644 --- a/apps/server/src/modules/system/service/system-oidc.service.spec.ts +++ b/apps/server/src/modules/system/service/system-oidc.service.spec.ts @@ -3,7 +3,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { EntityNotFoundError } from '@shared/common'; import { SystemEntity } from '@shared/domain/entity'; import { LegacySystemRepo } from '@shared/repo'; -import { systemEntityFactory } from '@shared/testing'; +import { systemEntityFactory } from '@shared/testing/factory'; import { SystemOidcMapper } from '../mapper/system-oidc.mapper'; import { SystemOidcService } from './system-oidc.service'; diff --git a/apps/server/src/modules/system/service/system.service.spec.ts b/apps/server/src/modules/system/service/system.service.spec.ts index 5c1eec8f486..d9514d94ee6 100644 --- a/apps/server/src/modules/system/service/system.service.spec.ts +++ b/apps/server/src/modules/system/service/system.service.spec.ts @@ -1,7 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; -import { systemFactory } from '@shared/testing'; +import { systemFactory } from '@shared/testing/factory'; import { SYSTEM_REPO, SystemRepo } from '../domain'; import { SystemService } from './system.service'; diff --git a/apps/server/src/modules/system/uc/system.uc.spec.ts b/apps/server/src/modules/system/uc/system.uc.spec.ts index 80202175beb..581288809ba 100644 --- a/apps/server/src/modules/system/uc/system.uc.spec.ts +++ b/apps/server/src/modules/system/uc/system.uc.spec.ts @@ -11,7 +11,13 @@ import { LegacySchoolDo } from '@shared/domain/domainobject'; import { SystemEntity } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; import { EntityId, SystemTypeEnum } from '@shared/domain/types'; -import { legacySchoolDoFactory, setupEntities, systemEntityFactory, systemFactory, userFactory } from '@shared/testing'; +import { + legacySchoolDoFactory, + setupEntities, + systemEntityFactory, + systemFactory, + userFactory, +} from '@shared/testing/factory'; import { SystemType } from '../domain'; import { SystemMapper } from '../mapper'; import { LegacySystemService, SystemService } from '../service'; diff --git a/apps/server/src/modules/task/mapper/submission.mapper.spec.ts b/apps/server/src/modules/task/mapper/submission.mapper.spec.ts index fda04359c6c..7355f0c71b7 100644 --- a/apps/server/src/modules/task/mapper/submission.mapper.spec.ts +++ b/apps/server/src/modules/task/mapper/submission.mapper.spec.ts @@ -1,4 +1,4 @@ -import { setupEntities, submissionFactory } from '@shared/testing'; +import { setupEntities, submissionFactory } from '@shared/testing/factory'; import { SubmissionStatusResponse } from '../controller/dto'; import { SubmissionMapper } from './submission.mapper'; diff --git a/apps/server/src/modules/task/mapper/task.mapper.spec.ts b/apps/server/src/modules/task/mapper/task.mapper.spec.ts index fe67dcaaaca..d4ac405034c 100644 --- a/apps/server/src/modules/task/mapper/task.mapper.spec.ts +++ b/apps/server/src/modules/task/mapper/task.mapper.spec.ts @@ -1,7 +1,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { Task, TaskParentDescriptions } from '@shared/domain/entity'; import { InputFormat, TaskStatus, TaskUpdate } from '@shared/domain/types'; -import { setupEntities, taskFactory } from '@shared/testing'; +import { setupEntities, taskFactory } from '@shared/testing/factory'; import { TaskCreateParams, TaskResponse, TaskStatusResponse, TaskUpdateParams } from '../controller/dto'; import { TaskMapper } from './task.mapper'; diff --git a/apps/server/src/modules/task/service/submission.service.spec.ts b/apps/server/src/modules/task/service/submission.service.spec.ts index 5500a4bde11..f760475a12e 100644 --- a/apps/server/src/modules/task/service/submission.service.spec.ts +++ b/apps/server/src/modules/task/service/submission.service.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Submission } from '@shared/domain/entity'; import { Counted } from '@shared/domain/types'; import { SubmissionRepo } from '@shared/repo'; -import { setupEntities, submissionFactory, taskFactory, userFactory } from '@shared/testing'; +import { setupEntities, submissionFactory, taskFactory, userFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { ObjectId } from 'bson'; import { EventBus } from '@nestjs/cqrs'; diff --git a/apps/server/src/modules/task/service/task.service.spec.ts b/apps/server/src/modules/task/service/task.service.spec.ts index 70dedcd12e7..54f0ef25bf9 100644 --- a/apps/server/src/modules/task/service/task.service.spec.ts +++ b/apps/server/src/modules/task/service/task.service.spec.ts @@ -1,7 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; import { TaskRepo } from '@shared/repo'; -import { courseFactory, setupEntities, submissionFactory, taskFactory, userFactory } from '@shared/testing'; +import { courseFactory, setupEntities, submissionFactory, taskFactory, userFactory } from '@shared/testing/factory'; import { FilesStorageClientAdapterService } from '@modules/files-storage-client'; import { Logger } from '@src/core/logger'; import { EventBus } from '@nestjs/cqrs'; diff --git a/apps/server/src/modules/task/uc/submission.uc.spec.ts b/apps/server/src/modules/task/uc/submission.uc.spec.ts index 688ff682ab9..254722a4ee2 100644 --- a/apps/server/src/modules/task/uc/submission.uc.spec.ts +++ b/apps/server/src/modules/task/uc/submission.uc.spec.ts @@ -4,7 +4,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Submission } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; import { Counted } from '@shared/domain/types'; -import { setupEntities, submissionFactory, taskFactory, userFactory } from '@shared/testing'; +import { setupEntities, submissionFactory, taskFactory, userFactory } from '@shared/testing/factory'; import { SubmissionService } from '../service/submission.service'; import { SubmissionUc } from './submission.uc'; diff --git a/apps/server/src/modules/task/uc/task-copy.uc.spec.ts b/apps/server/src/modules/task/uc/task-copy.uc.spec.ts index 182294cfd91..a04d7fe2a7a 100644 --- a/apps/server/src/modules/task/uc/task-copy.uc.spec.ts +++ b/apps/server/src/modules/task/uc/task-copy.uc.spec.ts @@ -8,7 +8,7 @@ import { LessonService } from '@modules/lesson'; import { ForbiddenException, InternalServerErrorException, NotFoundException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { CourseRepo, TaskRepo, UserRepo } from '@shared/repo'; -import { courseFactory, lessonFactory, setupEntities, taskFactory, userFactory } from '@shared/testing'; +import { courseFactory, lessonFactory, setupEntities, taskFactory, userFactory } from '@shared/testing/factory'; import { TaskCopyService } from '../service'; import { TaskCopyParentParams } from '../types'; import { TaskCopyUC } from './task-copy.uc'; diff --git a/apps/server/src/modules/teams/service/team.service.spec.ts b/apps/server/src/modules/teams/service/team.service.spec.ts index 7a9dd6959bf..d995cdf3d00 100644 --- a/apps/server/src/modules/teams/service/team.service.spec.ts +++ b/apps/server/src/modules/teams/service/team.service.spec.ts @@ -1,7 +1,7 @@ import { DeepMocked, createMock } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; import { TeamsRepo } from '@shared/repo'; -import { setupEntities, teamFactory, teamUserFactory } from '@shared/testing'; +import { setupEntities, teamFactory, teamUserFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { EventBus } from '@nestjs/cqrs/dist'; import { ObjectId } from 'bson'; diff --git a/apps/server/src/modules/tldraw/controller/api-test/tldraw.controller.401.api.spec.ts b/apps/server/src/modules/tldraw/controller/api-test/tldraw.controller.401.api.spec.ts index ef78734fba6..455db663f8b 100644 --- a/apps/server/src/modules/tldraw/controller/api-test/tldraw.controller.401.api.spec.ts +++ b/apps/server/src/modules/tldraw/controller/api-test/tldraw.controller.401.api.spec.ts @@ -1,6 +1,6 @@ import { INestApplication } from '@nestjs/common'; import { EntityManager } from '@mikro-orm/mongodb'; -import { courseFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; +import { courseFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing/factory'; import { Test, TestingModule } from '@nestjs/testing'; import { ServerTestModule } from '@modules/server'; import { Logger } from '@src/core/logger'; diff --git a/apps/server/src/modules/tldraw/controller/api-test/tldraw.controller.api.spec.ts b/apps/server/src/modules/tldraw/controller/api-test/tldraw.controller.api.spec.ts index c58dcf30600..f887c088304 100644 --- a/apps/server/src/modules/tldraw/controller/api-test/tldraw.controller.api.spec.ts +++ b/apps/server/src/modules/tldraw/controller/api-test/tldraw.controller.api.spec.ts @@ -1,6 +1,6 @@ import { ExecutionContext, INestApplication } from '@nestjs/common'; import { EntityManager } from '@mikro-orm/mongodb'; -import { courseFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; +import { courseFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing/factory'; import { Test, TestingModule } from '@nestjs/testing'; import { ServerTestModule } from '@modules/server'; import { Logger } from '@src/core/logger'; diff --git a/apps/server/src/modules/tldraw/controller/api-test/tldraw.ws.api.spec.ts b/apps/server/src/modules/tldraw/controller/api-test/tldraw.ws.api.spec.ts index 78e5d9b0163..0fb91c2d831 100644 --- a/apps/server/src/modules/tldraw/controller/api-test/tldraw.ws.api.spec.ts +++ b/apps/server/src/modules/tldraw/controller/api-test/tldraw.ws.api.spec.ts @@ -11,7 +11,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ConfigModule, ConfigService } from '@nestjs/config'; import { HttpService } from '@nestjs/axios'; import { AxiosError, AxiosHeaders, AxiosResponse } from 'axios'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { TldrawRedisFactory, TldrawRedisService } from '../../redis'; import { TldrawDrawing } from '../../entities'; import { TldrawWsService } from '../../service'; diff --git a/apps/server/src/modules/tool/common/domain/error/tool-parameter-mandatory-value-missing.loggable-exception.spec.ts b/apps/server/src/modules/tool/common/domain/error/tool-parameter-mandatory-value-missing.loggable-exception.spec.ts index 1dc12574766..3ef3cba7d88 100644 --- a/apps/server/src/modules/tool/common/domain/error/tool-parameter-mandatory-value-missing.loggable-exception.spec.ts +++ b/apps/server/src/modules/tool/common/domain/error/tool-parameter-mandatory-value-missing.loggable-exception.spec.ts @@ -1,4 +1,4 @@ -import { customParameterFactory } from '@shared/testing'; +import { customParameterFactory } from '@shared/testing/factory'; import { CustomParameter } from '../custom-parameter.do'; import { ToolParameterMandatoryValueMissingLoggableException } from './tool-parameter-mandatory-value-missing-loggable.exception'; diff --git a/apps/server/src/modules/tool/common/domain/error/tool-parameter-optional-value-missing-loggable-exception.spec.ts b/apps/server/src/modules/tool/common/domain/error/tool-parameter-optional-value-missing-loggable-exception.spec.ts index 2c047219822..45deb16f889 100644 --- a/apps/server/src/modules/tool/common/domain/error/tool-parameter-optional-value-missing-loggable-exception.spec.ts +++ b/apps/server/src/modules/tool/common/domain/error/tool-parameter-optional-value-missing-loggable-exception.spec.ts @@ -1,4 +1,4 @@ -import { customParameterFactory } from '@shared/testing'; +import { customParameterFactory } from '@shared/testing/factory'; import { CustomParameter } from '../custom-parameter.do'; import { ToolParameterOptionalValueMissingLoggableException } from './tool-parameter-optional-value-missing-loggable-exception'; diff --git a/apps/server/src/modules/tool/common/domain/error/tool-parameter-required.loggable-exception.spec.ts b/apps/server/src/modules/tool/common/domain/error/tool-parameter-required.loggable-exception.spec.ts index ff43272a8a3..4de9e060d12 100644 --- a/apps/server/src/modules/tool/common/domain/error/tool-parameter-required.loggable-exception.spec.ts +++ b/apps/server/src/modules/tool/common/domain/error/tool-parameter-required.loggable-exception.spec.ts @@ -1,4 +1,4 @@ -import { customParameterFactory } from '@shared/testing'; +import { customParameterFactory } from '@shared/testing/factory'; import { CustomParameter } from '../custom-parameter.do'; import { ToolParameterRequiredLoggableException } from './tool-parameter-required.loggable-exception'; diff --git a/apps/server/src/modules/tool/common/domain/error/tool-parameter-type-mismatch.loggable-exception.spec.ts b/apps/server/src/modules/tool/common/domain/error/tool-parameter-type-mismatch.loggable-exception.spec.ts index e3d1692af13..296ae223062 100644 --- a/apps/server/src/modules/tool/common/domain/error/tool-parameter-type-mismatch.loggable-exception.spec.ts +++ b/apps/server/src/modules/tool/common/domain/error/tool-parameter-type-mismatch.loggable-exception.spec.ts @@ -1,4 +1,4 @@ -import { customParameterFactory } from '@shared/testing'; +import { customParameterFactory } from '@shared/testing/factory'; import { CustomParameter } from '../custom-parameter.do'; import { ToolParameterTypeMismatchLoggableException } from './tool-parameter-type-mismatch.loggable-exception'; diff --git a/apps/server/src/modules/tool/common/domain/error/tool-parameter-value-regex.loggable-exception.spec.ts b/apps/server/src/modules/tool/common/domain/error/tool-parameter-value-regex.loggable-exception.spec.ts index 3f21d07beda..01f14a96294 100644 --- a/apps/server/src/modules/tool/common/domain/error/tool-parameter-value-regex.loggable-exception.spec.ts +++ b/apps/server/src/modules/tool/common/domain/error/tool-parameter-value-regex.loggable-exception.spec.ts @@ -1,4 +1,4 @@ -import { customParameterFactory } from '@shared/testing'; +import { customParameterFactory } from '@shared/testing/factory'; import { CustomParameter } from '../custom-parameter.do'; import { ToolParameterValueRegexLoggableException } from './tool-parameter-value-regex.loggable-exception'; diff --git a/apps/server/src/modules/tool/common/service/common-tool-metadata.service.spec.ts b/apps/server/src/modules/tool/common/service/common-tool-metadata.service.spec.ts index 6b4af06ab1c..134558d7d5c 100644 --- a/apps/server/src/modules/tool/common/service/common-tool-metadata.service.spec.ts +++ b/apps/server/src/modules/tool/common/service/common-tool-metadata.service.spec.ts @@ -3,7 +3,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { ContentElementService } from '@modules/board'; import { Test, TestingModule } from '@nestjs/testing'; import { ContextExternalToolRepo, SchoolExternalToolRepo } from '@shared/repo'; -import { contextExternalToolFactory, schoolExternalToolFactory } from '@shared/testing'; +import { contextExternalToolFactory, schoolExternalToolFactory } from '@shared/testing/factory'; import { ContextExternalTool } from '../../context-external-tool/domain'; import { ExternalToolMetadata } from '../../external-tool/domain'; import { SchoolExternalTool, SchoolExternalToolMetadata } from '../../school-external-tool/domain'; diff --git a/apps/server/src/modules/tool/common/service/common-tool.service.spec.ts b/apps/server/src/modules/tool/common/service/common-tool.service.spec.ts index b828c2ee8fc..1315061f8db 100644 --- a/apps/server/src/modules/tool/common/service/common-tool.service.spec.ts +++ b/apps/server/src/modules/tool/common/service/common-tool.service.spec.ts @@ -1,5 +1,5 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { externalToolFactory } from '@shared/testing'; +import { externalToolFactory } from '@shared/testing/factory'; import { ExternalTool } from '../../external-tool/domain'; import { ToolContextType } from '../enum'; import { CommonToolService } from './common-tool.service'; diff --git a/apps/server/src/modules/tool/common/service/validation/rules/parameter-array-entry-validator.spec.ts b/apps/server/src/modules/tool/common/service/validation/rules/parameter-array-entry-validator.spec.ts index 6704abe4857..7a7a0a5e66c 100644 --- a/apps/server/src/modules/tool/common/service/validation/rules/parameter-array-entry-validator.spec.ts +++ b/apps/server/src/modules/tool/common/service/validation/rules/parameter-array-entry-validator.spec.ts @@ -1,5 +1,5 @@ import { ValidationError } from '@shared/common'; -import { customParameterFactory } from '@shared/testing'; +import { customParameterFactory } from '@shared/testing/factory'; import { CustomParameter, CustomParameterEntry, diff --git a/apps/server/src/modules/tool/common/service/validation/rules/parameter-array-unknown-key-validator.spec.ts b/apps/server/src/modules/tool/common/service/validation/rules/parameter-array-unknown-key-validator.spec.ts index 6539d93d060..04a2adfa48d 100644 --- a/apps/server/src/modules/tool/common/service/validation/rules/parameter-array-unknown-key-validator.spec.ts +++ b/apps/server/src/modules/tool/common/service/validation/rules/parameter-array-unknown-key-validator.spec.ts @@ -1,5 +1,5 @@ import { ValidationError } from '@shared/common'; -import { customParameterFactory } from '@shared/testing'; +import { customParameterFactory } from '@shared/testing/factory'; import { CustomParameter, CustomParameterEntry, ToolParameterUnknownLoggableException } from '../../../domain'; import { ParameterArrayUnknownKeyValidator } from './parameter-array-unknown-key-validator'; diff --git a/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-regex-validator.spec.ts b/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-regex-validator.spec.ts index c1f505fd5b5..76dce6ed147 100644 --- a/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-regex-validator.spec.ts +++ b/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-regex-validator.spec.ts @@ -1,5 +1,5 @@ import { ValidationError } from '@shared/common'; -import { customParameterFactory } from '@shared/testing'; +import { customParameterFactory } from '@shared/testing/factory'; import { CustomParameter, CustomParameterEntry, ToolParameterValueRegexLoggableException } from '../../../domain'; import { ParameterEntryRegexValidator } from './parameter-entry-regex-validator'; diff --git a/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-type-validator.spec.ts b/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-type-validator.spec.ts index 601ec3c2e54..73452970523 100644 --- a/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-type-validator.spec.ts +++ b/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-type-validator.spec.ts @@ -1,5 +1,5 @@ import { ValidationError } from '@shared/common'; -import { customParameterFactory } from '@shared/testing'; +import { customParameterFactory } from '@shared/testing/factory'; import { CustomParameter, CustomParameterEntry, ToolParameterTypeMismatchLoggableException } from '../../../domain'; import { CustomParameterType } from '../../../enum'; import { ParameterEntryTypeValidator } from './parameter-entry-type-validator'; diff --git a/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-value-validator.spec.ts b/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-value-validator.spec.ts index 4784f3054c8..97d1ea914b9 100644 --- a/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-value-validator.spec.ts +++ b/apps/server/src/modules/tool/common/service/validation/rules/parameter-entry-value-validator.spec.ts @@ -1,5 +1,5 @@ import { ValidationError } from '@shared/common'; -import { customParameterFactory } from '@shared/testing'; +import { customParameterFactory } from '@shared/testing/factory'; import { CustomParameter, CustomParameterEntry, diff --git a/apps/server/src/modules/tool/context-external-tool/service/context-external-tool-authorizable.service.spec.ts b/apps/server/src/modules/tool/context-external-tool/service/context-external-tool-authorizable.service.spec.ts index a0698e904a9..2f9e3d48457 100644 --- a/apps/server/src/modules/tool/context-external-tool/service/context-external-tool-authorizable.service.spec.ts +++ b/apps/server/src/modules/tool/context-external-tool/service/context-external-tool-authorizable.service.spec.ts @@ -1,4 +1,4 @@ -import { contextExternalToolFactory, legacySchoolDoFactory, schoolExternalToolFactory } from '@shared/testing'; +import { contextExternalToolFactory, legacySchoolDoFactory, schoolExternalToolFactory } from '@shared/testing/factory'; import { Test, TestingModule } from '@nestjs/testing'; import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ContextExternalToolRepo } from '@shared/repo'; diff --git a/apps/server/src/modules/tool/context-external-tool/service/context-external-tool-validation.service.spec.ts b/apps/server/src/modules/tool/context-external-tool/service/context-external-tool-validation.service.spec.ts index 29cdba8d13e..f637ca44a40 100644 --- a/apps/server/src/modules/tool/context-external-tool/service/context-external-tool-validation.service.spec.ts +++ b/apps/server/src/modules/tool/context-external-tool/service/context-external-tool-validation.service.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { UnprocessableEntityException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { ValidationError } from '@shared/common'; -import { contextExternalToolFactory, externalToolFactory } from '@shared/testing'; +import { contextExternalToolFactory, externalToolFactory } from '@shared/testing/factory'; import { ContextExternalToolNameAlreadyExistsLoggableException } from '@modules/tool/common/domain'; import { CommonToolValidationService } from '../../common/service'; import { ExternalTool } from '../../external-tool/domain'; diff --git a/apps/server/src/modules/tool/context-external-tool/uc/context-external-tool.uc.spec.ts b/apps/server/src/modules/tool/context-external-tool/uc/context-external-tool.uc.spec.ts index d6b868b8d01..937e5a4ed8a 100644 --- a/apps/server/src/modules/tool/context-external-tool/uc/context-external-tool.uc.spec.ts +++ b/apps/server/src/modules/tool/context-external-tool/uc/context-external-tool.uc.spec.ts @@ -13,7 +13,12 @@ import { Test, TestingModule } from '@nestjs/testing'; import { User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; import { EntityId } from '@shared/domain/types'; -import { contextExternalToolFactory, schoolExternalToolFactory, setupEntities, userFactory } from '@shared/testing'; +import { + contextExternalToolFactory, + schoolExternalToolFactory, + setupEntities, + userFactory, +} from '@shared/testing/factory'; import { ToolContextType } from '../../common/enum'; import { ToolPermissionHelper } from '../../common/uc/tool-permission-helper'; import { SchoolExternalToolWithId } from '../../school-external-tool/domain'; diff --git a/apps/server/src/modules/tool/context-external-tool/uc/tool-reference.uc.spec.ts b/apps/server/src/modules/tool/context-external-tool/uc/tool-reference.uc.spec.ts index 439a5b671ab..d5d99b34fd0 100644 --- a/apps/server/src/modules/tool/context-external-tool/uc/tool-reference.uc.spec.ts +++ b/apps/server/src/modules/tool/context-external-tool/uc/tool-reference.uc.spec.ts @@ -3,7 +3,11 @@ import { AuthorizationContextBuilder, AuthorizationService } from '@modules/auth import { ForbiddenException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; -import { contextExternalToolFactory, externalToolFactory, toolConfigurationStatusFactory } from '@shared/testing'; +import { + contextExternalToolFactory, + externalToolFactory, + toolConfigurationStatusFactory, +} from '@shared/testing/factory'; import { ToolContextType } from '../../common/enum'; import { ToolPermissionHelper } from '../../common/uc/tool-permission-helper'; import { ExternalTool } from '../../external-tool/domain'; diff --git a/apps/server/src/modules/tool/external-tool/domain/external-tool.do.spec.ts b/apps/server/src/modules/tool/external-tool/domain/external-tool.do.spec.ts index b47fef01f6a..6c3e5ca6c0d 100644 --- a/apps/server/src/modules/tool/external-tool/domain/external-tool.do.spec.ts +++ b/apps/server/src/modules/tool/external-tool/domain/external-tool.do.spec.ts @@ -1,4 +1,4 @@ -import { basicToolConfigFactory, externalToolFactory } from '@shared/testing'; +import { basicToolConfigFactory, externalToolFactory } from '@shared/testing/factory'; import { ExternalTool } from './external-tool.do'; describe('ExternalTool', () => { diff --git a/apps/server/src/modules/tool/external-tool/service/external-tool-logo-service.spec.ts b/apps/server/src/modules/tool/external-tool/service/external-tool-logo-service.spec.ts index 32388ad6c32..9553fbe2122 100644 --- a/apps/server/src/modules/tool/external-tool/service/external-tool-logo-service.spec.ts +++ b/apps/server/src/modules/tool/external-tool/service/external-tool-logo-service.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { HttpService } from '@nestjs/axios'; import { HttpException, HttpStatus } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { axiosResponseFactory, externalToolFactory } from '@shared/testing'; +import { axiosResponseFactory, externalToolFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { of, throwError } from 'rxjs'; import { IToolFeatures, ToolFeatures } from '../../tool-config'; diff --git a/apps/server/src/modules/tool/external-tool/service/external-tool.service.spec.ts b/apps/server/src/modules/tool/external-tool/service/external-tool.service.spec.ts index 16568324e53..4f8c8d9a042 100644 --- a/apps/server/src/modules/tool/external-tool/service/external-tool.service.spec.ts +++ b/apps/server/src/modules/tool/external-tool/service/external-tool.service.spec.ts @@ -9,7 +9,7 @@ import { Page } from '@shared/domain/domainobject'; import { IFindOptions, SortOrder } from '@shared/domain/interface'; import { ContextExternalToolRepo, ExternalToolRepo, SchoolExternalToolRepo } from '@shared/repo'; import { LegacyLogger } from '@src/core/logger'; -import { externalToolFactory, lti11ToolConfigFactory, oauth2ToolConfigFactory } from '@shared/testing'; +import { externalToolFactory, lti11ToolConfigFactory, oauth2ToolConfigFactory } from '@shared/testing/factory'; import { ExternalToolSearchQuery } from '../../common/interface'; import { SchoolExternalTool } from '../../school-external-tool/domain'; import { ExternalTool, Lti11ToolConfig, Oauth2ToolConfig } from '../domain'; diff --git a/apps/server/src/modules/tool/school-external-tool/mapper/school-external-tool-request.mapper.spec.ts b/apps/server/src/modules/tool/school-external-tool/mapper/school-external-tool-request.mapper.spec.ts index dbbc9717c04..58afb6ad7ab 100644 --- a/apps/server/src/modules/tool/school-external-tool/mapper/school-external-tool-request.mapper.spec.ts +++ b/apps/server/src/modules/tool/school-external-tool/mapper/school-external-tool-request.mapper.spec.ts @@ -1,4 +1,4 @@ -import { schoolToolConfigurationStatusFactory } from '@shared/testing'; +import { schoolToolConfigurationStatusFactory } from '@shared/testing/factory'; import { SchoolExternalToolRequestMapper } from './school-external-tool-request.mapper'; import { SchoolExternalToolDto } from '../uc/dto/school-external-tool.types'; import { CustomParameterEntryParam, SchoolExternalToolPostParams } from '../controller/dto'; diff --git a/apps/server/src/modules/tool/school-external-tool/service/school-external-tool-validation.service.spec.ts b/apps/server/src/modules/tool/school-external-tool/service/school-external-tool-validation.service.spec.ts index 8d1b0e040e4..fc91649f112 100644 --- a/apps/server/src/modules/tool/school-external-tool/service/school-external-tool-validation.service.spec.ts +++ b/apps/server/src/modules/tool/school-external-tool/service/school-external-tool-validation.service.spec.ts @@ -1,7 +1,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; import { ValidationError } from '@shared/common'; -import { externalToolFactory, schoolExternalToolFactory } from '@shared/testing'; +import { externalToolFactory, schoolExternalToolFactory } from '@shared/testing/factory'; import { CommonToolValidationService } from '../../common/service'; import { ExternalTool } from '../../external-tool/domain'; import { ExternalToolService } from '../../external-tool/service'; diff --git a/apps/server/src/modules/tool/school-external-tool/uc/school-external-tool.uc.spec.ts b/apps/server/src/modules/tool/school-external-tool/uc/school-external-tool.uc.spec.ts index 39c6a4d6a36..0454ca837ca 100644 --- a/apps/server/src/modules/tool/school-external-tool/uc/school-external-tool.uc.spec.ts +++ b/apps/server/src/modules/tool/school-external-tool/uc/school-external-tool.uc.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; import { EntityId } from '@shared/domain/types'; -import { schoolExternalToolFactory, setupEntities, userFactory } from '@shared/testing'; +import { schoolExternalToolFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { School, SchoolService } from '@src/modules/school'; import { schoolFactory } from '@modules/school/testing'; import { CommonToolMetadataService } from '../../common/service/common-tool-metadata.service'; diff --git a/apps/server/src/modules/tool/tool-launch/error/missing-tool-parameter-value.loggable-exception.spec.ts b/apps/server/src/modules/tool/tool-launch/error/missing-tool-parameter-value.loggable-exception.spec.ts index 3a903976f06..bfd5af4b638 100644 --- a/apps/server/src/modules/tool/tool-launch/error/missing-tool-parameter-value.loggable-exception.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/error/missing-tool-parameter-value.loggable-exception.spec.ts @@ -1,4 +1,4 @@ -import { contextExternalToolFactory, customParameterFactory } from '@shared/testing'; +import { contextExternalToolFactory, customParameterFactory } from '@shared/testing/factory'; import { MissingToolParameterValueLoggableException } from './missing-tool-parameter-value.loggable-exception'; import { ContextExternalTool } from '../../context-external-tool/domain'; import { CustomParameter } from '../../common/domain'; diff --git a/apps/server/src/modules/tool/tool-launch/error/tool-status-not-launchable.loggable-exception.spec.ts b/apps/server/src/modules/tool/tool-launch/error/tool-status-not-launchable.loggable-exception.spec.ts index 3c081301fdd..7f596806bdc 100644 --- a/apps/server/src/modules/tool/tool-launch/error/tool-status-not-launchable.loggable-exception.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/error/tool-status-not-launchable.loggable-exception.spec.ts @@ -1,4 +1,4 @@ -import { toolConfigurationStatusFactory } from '@shared/testing'; +import { toolConfigurationStatusFactory } from '@shared/testing/factory'; import { ToolStatusNotLaunchableLoggableException } from './tool-status-not-launchable.loggable-exception'; describe('ToolStatusNotLaunchableLoggableException', () => { diff --git a/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-context-id.strategy.spec.ts b/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-context-id.strategy.spec.ts index d1865d231c2..4ac2da68029 100644 --- a/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-context-id.strategy.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-context-id.strategy.spec.ts @@ -1,5 +1,5 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { contextExternalToolFactory, schoolExternalToolFactory } from '@shared/testing'; +import { contextExternalToolFactory, schoolExternalToolFactory } from '@shared/testing/factory'; import { ContextExternalTool } from '../../../context-external-tool/domain'; import { SchoolExternalTool } from '../../../school-external-tool/domain'; import { AutoContextIdStrategy } from './auto-context-id.strategy'; diff --git a/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-medium-id.strategy.spec.ts b/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-medium-id.strategy.spec.ts index 79fdfaa0a20..7399d3f057e 100644 --- a/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-medium-id.strategy.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-medium-id.strategy.spec.ts @@ -1,6 +1,6 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; -import { contextExternalToolFactory, externalToolFactory, schoolExternalToolFactory } from '@shared/testing'; +import { contextExternalToolFactory, externalToolFactory, schoolExternalToolFactory } from '@shared/testing/factory'; import { ContextExternalTool } from '../../../context-external-tool/domain'; import { ExternalTool } from '../../../external-tool/domain'; import { ExternalToolService } from '../../../external-tool/service'; diff --git a/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-school-id.strategy.spec.ts b/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-school-id.strategy.spec.ts index 2b184c51140..525c2625664 100644 --- a/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-school-id.strategy.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-school-id.strategy.spec.ts @@ -1,5 +1,5 @@ import { Test, TestingModule } from '@nestjs/testing'; -import { contextExternalToolFactory, schoolExternalToolFactory } from '@shared/testing'; +import { contextExternalToolFactory, schoolExternalToolFactory } from '@shared/testing/factory'; import { ContextExternalTool } from '../../../context-external-tool/domain'; import { SchoolExternalTool } from '../../../school-external-tool/domain'; import { AutoSchoolIdStrategy } from './auto-school-id.strategy'; diff --git a/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-school-number.strategy.spec.ts b/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-school-number.strategy.spec.ts index 01f67d2c98e..5543dd86188 100644 --- a/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-school-number.strategy.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/service/auto-parameter-strategy/auto-school-number.strategy.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { LegacySchoolService } from '@modules/legacy-school'; import { Test, TestingModule } from '@nestjs/testing'; import { LegacySchoolDo } from '@shared/domain/domainobject'; -import { contextExternalToolFactory, legacySchoolDoFactory, schoolExternalToolFactory } from '@shared/testing'; +import { contextExternalToolFactory, legacySchoolDoFactory, schoolExternalToolFactory } from '@shared/testing/factory'; import { ContextExternalTool } from '../../../context-external-tool/domain'; import { SchoolExternalTool } from '../../../school-external-tool/domain'; import { AutoSchoolNumberStrategy } from './auto-school-number.strategy'; diff --git a/apps/server/src/modules/tool/tool-launch/service/launch-strategy/basic-tool-launch.strategy.spec.ts b/apps/server/src/modules/tool/tool-launch/service/launch-strategy/basic-tool-launch.strategy.spec.ts index 7335f0d149a..3360e91d74d 100644 --- a/apps/server/src/modules/tool/tool-launch/service/launch-strategy/basic-tool-launch.strategy.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/service/launch-strategy/basic-tool-launch.strategy.spec.ts @@ -1,6 +1,6 @@ import { createMock } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; -import { contextExternalToolFactory, externalToolFactory, schoolExternalToolFactory } from '@shared/testing'; +import { contextExternalToolFactory, externalToolFactory, schoolExternalToolFactory } from '@shared/testing/factory'; import { ContextExternalTool } from '../../../context-external-tool/domain'; import { ExternalTool } from '../../../external-tool/domain'; import { SchoolExternalTool } from '../../../school-external-tool/domain'; diff --git a/apps/server/src/modules/tool/tool-launch/service/launch-strategy/oauth2-tool-launch.strategy.spec.ts b/apps/server/src/modules/tool/tool-launch/service/launch-strategy/oauth2-tool-launch.strategy.spec.ts index d1e1e1662fb..61443ee410d 100644 --- a/apps/server/src/modules/tool/tool-launch/service/launch-strategy/oauth2-tool-launch.strategy.spec.ts +++ b/apps/server/src/modules/tool/tool-launch/service/launch-strategy/oauth2-tool-launch.strategy.spec.ts @@ -1,6 +1,6 @@ import { createMock } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; -import { contextExternalToolFactory, externalToolFactory, schoolExternalToolFactory } from '@shared/testing'; +import { contextExternalToolFactory, externalToolFactory, schoolExternalToolFactory } from '@shared/testing/factory'; import { ContextExternalTool } from '../../../context-external-tool/domain'; import { ExternalTool } from '../../../external-tool/domain'; import { SchoolExternalTool } from '../../../school-external-tool/domain'; diff --git a/apps/server/src/modules/user-import/controller/api-test/import-user-populate.api.spec.ts b/apps/server/src/modules/user-import/controller/api-test/import-user-populate.api.spec.ts index b32653f4eb5..18dffbaedf1 100644 --- a/apps/server/src/modules/user-import/controller/api-test/import-user-populate.api.spec.ts +++ b/apps/server/src/modules/user-import/controller/api-test/import-user-populate.api.spec.ts @@ -6,7 +6,13 @@ import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission, RoleName } from '@shared/domain/interface'; import { SchoolFeature } from '@shared/domain/types'; -import { TestApiClient, roleFactory, schoolEntityFactory, systemEntityFactory, userFactory } from '@shared/testing'; +import { + TestApiClient, + roleFactory, + schoolEntityFactory, + systemEntityFactory, + userFactory, +} from '@shared/testing/factory'; import { accountFactory } from '@src/modules/account/testing'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; diff --git a/apps/server/src/modules/user-import/mapper/import-user.mapper.spec.ts b/apps/server/src/modules/user-import/mapper/import-user.mapper.spec.ts index 881b8fc6c4b..a67239c957a 100644 --- a/apps/server/src/modules/user-import/mapper/import-user.mapper.spec.ts +++ b/apps/server/src/modules/user-import/mapper/import-user.mapper.spec.ts @@ -2,7 +2,7 @@ import { BadRequestException } from '@nestjs/common'; import { MatchCreator } from '@shared/domain/entity'; import { RoleName, SortOrder } from '@shared/domain/interface'; import { MatchCreatorScope } from '@shared/domain/types'; -import { importUserFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing'; +import { importUserFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { FilterImportUserParams, FilterMatchType, diff --git a/apps/server/src/modules/user-import/mapper/user-match.mapper.spec.ts b/apps/server/src/modules/user-import/mapper/user-match.mapper.spec.ts index bd9fe337b19..309f735e3d3 100644 --- a/apps/server/src/modules/user-import/mapper/user-match.mapper.spec.ts +++ b/apps/server/src/modules/user-import/mapper/user-match.mapper.spec.ts @@ -1,6 +1,6 @@ import { MatchCreator } from '@shared/domain/entity'; import { RoleName } from '@shared/domain/interface'; -import { roleFactory, setupEntities, userFactory } from '@shared/testing'; +import { roleFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { MatchType, UserRole } from '../controller/dto'; import { FilterUserParams } from '../controller/dto/filter-user.params'; import { ImportUserMatchMapper } from './match.mapper'; diff --git a/apps/server/src/modules/user-import/uc/user-import-fetch.uc.spec.ts b/apps/server/src/modules/user-import/uc/user-import-fetch.uc.spec.ts index c80032261e7..3cae846c9b7 100644 --- a/apps/server/src/modules/user-import/uc/user-import-fetch.uc.spec.ts +++ b/apps/server/src/modules/user-import/uc/user-import-fetch.uc.spec.ts @@ -4,7 +4,7 @@ import { AuthorizationService } from '@modules/authorization'; import { Test, TestingModule } from '@nestjs/testing'; import { ImportUser, SystemEntity, User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { importUserFactory, setupEntities, systemEntityFactory, userFactory } from '@shared/testing'; +import { importUserFactory, setupEntities, systemEntityFactory, userFactory } from '@shared/testing/factory'; import { IUserImportFeatures, UserImportFeatures } from '../config'; import { UserMigrationIsNotEnabledLoggableException } from '../loggable'; import { SchulconnexFetchImportUsersService, UserImportService } from '../service'; diff --git a/apps/server/src/modules/user-license/repo/user-license.repo.spec.ts b/apps/server/src/modules/user-license/repo/user-license.repo.spec.ts index 016d547729f..21471457986 100644 --- a/apps/server/src/modules/user-license/repo/user-license.repo.spec.ts +++ b/apps/server/src/modules/user-license/repo/user-license.repo.spec.ts @@ -3,7 +3,7 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { InternalServerErrorException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { User as UserEntity } from '@shared/domain/entity'; -import { cleanupCollections, userFactory } from '@shared/testing'; +import { cleanupCollections, userFactory } from '@shared/testing/factory'; import { MediaUserLicense } from '../domain'; import { MediaUserLicenseEntity, UserLicenseEntity, UserLicenseType } from '../entity'; import { mediaUserLicenseEntityFactory, mediaUserLicenseFactory } from '../testing'; diff --git a/apps/server/src/modules/user-license/testing/media-user-license-entity.factory.ts b/apps/server/src/modules/user-license/testing/media-user-license-entity.factory.ts index bf46daee6b6..ec87804ad3b 100644 --- a/apps/server/src/modules/user-license/testing/media-user-license-entity.factory.ts +++ b/apps/server/src/modules/user-license/testing/media-user-license-entity.factory.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { BaseFactory, userFactory } from '@shared/testing'; +import { BaseFactory, userFactory } from '@shared/testing/factory'; import { MediaUserLicenseEntity, MediaUserLicenseEntityProps, UserLicenseType } from '../entity'; export const mediaUserLicenseEntityFactory = BaseFactory.define( diff --git a/apps/server/src/modules/user-license/testing/media-user-license.factory.ts b/apps/server/src/modules/user-license/testing/media-user-license.factory.ts index 71d6cd00383..34207a19eca 100644 --- a/apps/server/src/modules/user-license/testing/media-user-license.factory.ts +++ b/apps/server/src/modules/user-license/testing/media-user-license.factory.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; import { MediaUserLicense } from '../domain'; import { MediaUserLicenseProps } from '../domain/media-user-license'; import { UserLicenseType } from '../entity'; diff --git a/apps/server/src/modules/user-login-migration/loggable/debug/school-migration-successful.loggable.spec.ts b/apps/server/src/modules/user-login-migration/loggable/debug/school-migration-successful.loggable.spec.ts index d5e8d7407f6..fe1f3d09c5d 100644 --- a/apps/server/src/modules/user-login-migration/loggable/debug/school-migration-successful.loggable.spec.ts +++ b/apps/server/src/modules/user-login-migration/loggable/debug/school-migration-successful.loggable.spec.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { legacySchoolDoFactory, userLoginMigrationDOFactory } from '@shared/testing'; +import { legacySchoolDoFactory, userLoginMigrationDOFactory } from '@shared/testing/factory'; import { SchoolMigrationSuccessfulLoggable } from './school-migration-successful.loggable'; describe(SchoolMigrationSuccessfulLoggable.name, () => { diff --git a/apps/server/src/modules/user-login-migration/loggable/debug/user-migration-started.loggable.spec.ts b/apps/server/src/modules/user-login-migration/loggable/debug/user-migration-started.loggable.spec.ts index 22c2ded1b67..cf3e7f81654 100644 --- a/apps/server/src/modules/user-login-migration/loggable/debug/user-migration-started.loggable.spec.ts +++ b/apps/server/src/modules/user-login-migration/loggable/debug/user-migration-started.loggable.spec.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { userLoginMigrationDOFactory } from '@shared/testing'; +import { userLoginMigrationDOFactory } from '@shared/testing/factory'; import { UserMigrationStartedLoggable } from './user-migration-started.loggable'; describe(UserMigrationStartedLoggable.name, () => { diff --git a/apps/server/src/modules/user-login-migration/loggable/debug/user-migration-successful.loggable.spec.ts b/apps/server/src/modules/user-login-migration/loggable/debug/user-migration-successful.loggable.spec.ts index aae8baf96d9..ab6c323213e 100644 --- a/apps/server/src/modules/user-login-migration/loggable/debug/user-migration-successful.loggable.spec.ts +++ b/apps/server/src/modules/user-login-migration/loggable/debug/user-migration-successful.loggable.spec.ts @@ -1,5 +1,5 @@ import { ObjectId } from '@mikro-orm/mongodb'; -import { userLoginMigrationDOFactory } from '@shared/testing'; +import { userLoginMigrationDOFactory } from '@shared/testing/factory'; import { UserMigrationSuccessfulLoggable } from './user-migration-successful.loggable'; describe(UserMigrationSuccessfulLoggable.name, () => { diff --git a/apps/server/src/modules/user-login-migration/loggable/school-migration-database-operation-failed.loggable-exception.spec.ts b/apps/server/src/modules/user-login-migration/loggable/school-migration-database-operation-failed.loggable-exception.spec.ts index 701b5a6a4fe..cb106ed8efd 100644 --- a/apps/server/src/modules/user-login-migration/loggable/school-migration-database-operation-failed.loggable-exception.spec.ts +++ b/apps/server/src/modules/user-login-migration/loggable/school-migration-database-operation-failed.loggable-exception.spec.ts @@ -1,4 +1,4 @@ -import { legacySchoolDoFactory } from '@shared/testing'; +import { legacySchoolDoFactory } from '@shared/testing/factory'; import { SchoolMigrationDatabaseOperationFailedLoggableException } from './school-migration-database-operation-failed.loggable-exception'; describe(SchoolMigrationDatabaseOperationFailedLoggableException.name, () => { diff --git a/apps/server/src/modules/user-login-migration/service/migration-check.service.spec.ts b/apps/server/src/modules/user-login-migration/service/migration-check.service.spec.ts index 2bcef2646c6..f29b99a1821 100644 --- a/apps/server/src/modules/user-login-migration/service/migration-check.service.spec.ts +++ b/apps/server/src/modules/user-login-migration/service/migration-check.service.spec.ts @@ -4,7 +4,7 @@ import { UserService } from '@modules/user'; import { Test, TestingModule } from '@nestjs/testing'; import { LegacySchoolDo, UserDO, UserLoginMigrationDO } from '@shared/domain/domainobject'; import { UserLoginMigrationRepo } from '@shared/repo'; -import { legacySchoolDoFactory, userDoFactory } from '@shared/testing'; +import { legacySchoolDoFactory, userDoFactory } from '@shared/testing/factory'; import { MigrationCheckService } from './migration-check.service'; describe('MigrationCheckService', () => { diff --git a/apps/server/src/modules/user-login-migration/service/school-migration.service.spec.ts b/apps/server/src/modules/user-login-migration/service/school-migration.service.spec.ts index 3d1bb7d1598..26d528e0d6f 100644 --- a/apps/server/src/modules/user-login-migration/service/school-migration.service.spec.ts +++ b/apps/server/src/modules/user-login-migration/service/school-migration.service.spec.ts @@ -5,7 +5,12 @@ import { UserService } from '@modules/user'; import { Test, TestingModule } from '@nestjs/testing'; import { LegacySchoolDo, Page, UserDO, UserLoginMigrationDO } from '@shared/domain/domainobject'; import { UserLoginMigrationRepo } from '@shared/repo/userloginmigration/user-login-migration.repo'; -import { legacySchoolDoFactory, setupEntities, userDoFactory, userLoginMigrationDOFactory } from '@shared/testing'; +import { + legacySchoolDoFactory, + setupEntities, + userDoFactory, + userLoginMigrationDOFactory, +} from '@shared/testing/factory'; import { LegacyLogger, Logger } from '@src/core/logger'; import { SchoolMigrationDatabaseOperationFailedLoggableException, diff --git a/apps/server/src/modules/user-login-migration/service/user-login-migration-revert.service.spec.ts b/apps/server/src/modules/user-login-migration/service/user-login-migration-revert.service.spec.ts index fd94f69d66e..99e36e9529f 100644 --- a/apps/server/src/modules/user-login-migration/service/user-login-migration-revert.service.spec.ts +++ b/apps/server/src/modules/user-login-migration/service/user-login-migration-revert.service.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { LegacySchoolService } from '@modules/legacy-school'; import { Test, TestingModule } from '@nestjs/testing'; import { SchoolFeature } from '@shared/domain/types'; -import { userLoginMigrationDOFactory } from '@shared/testing'; +import { userLoginMigrationDOFactory } from '@shared/testing/factory'; import { UserLoginMigrationRevertService } from './user-login-migration-revert.service'; import { UserLoginMigrationService } from './user-login-migration.service'; diff --git a/apps/server/src/modules/user-login-migration/service/user-login-migration-rollback.service.spec.ts b/apps/server/src/modules/user-login-migration/service/user-login-migration-rollback.service.spec.ts index e40674c2e10..b45b7a9de13 100644 --- a/apps/server/src/modules/user-login-migration/service/user-login-migration-rollback.service.spec.ts +++ b/apps/server/src/modules/user-login-migration/service/user-login-migration-rollback.service.spec.ts @@ -4,7 +4,7 @@ import { Account, AccountService } from '@modules/account'; import { UserService } from '@modules/user'; import { Test, TestingModule } from '@nestjs/testing'; import { UserDO } from '@shared/domain/domainobject'; -import { userDoFactory, userLoginMigrationDOFactory } from '@shared/testing'; +import { userDoFactory, userLoginMigrationDOFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { accountDoFactory } from '@src/modules/account/testing'; import { diff --git a/apps/server/src/modules/user-login-migration/service/user-login-migration.service.spec.ts b/apps/server/src/modules/user-login-migration/service/user-login-migration.service.spec.ts index ee4a7cff300..588719a9093 100644 --- a/apps/server/src/modules/user-login-migration/service/user-login-migration.service.spec.ts +++ b/apps/server/src/modules/user-login-migration/service/user-login-migration.service.spec.ts @@ -9,7 +9,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { LegacySchoolDo, UserDO, UserLoginMigrationDO } from '@shared/domain/domainobject'; import { EntityId, SchoolFeature } from '@shared/domain/types'; import { UserLoginMigrationRepo } from '@shared/repo'; -import { legacySchoolDoFactory, userDoFactory, userLoginMigrationDOFactory } from '@shared/testing'; +import { legacySchoolDoFactory, userDoFactory, userLoginMigrationDOFactory } from '@shared/testing/factory'; import { IdenticalUserLoginMigrationSystemLoggableException, MoinSchuleSystemNotFoundLoggableException, diff --git a/apps/server/src/modules/user-login-migration/service/user-migration.service.spec.ts b/apps/server/src/modules/user-login-migration/service/user-migration.service.spec.ts index baabb4f8f82..108a4d337b5 100644 --- a/apps/server/src/modules/user-login-migration/service/user-migration.service.spec.ts +++ b/apps/server/src/modules/user-login-migration/service/user-migration.service.spec.ts @@ -4,7 +4,7 @@ import { AccountService, Account } from '@modules/account'; import { UserService } from '@modules/user'; import { Test, TestingModule } from '@nestjs/testing'; import { UserDO } from '@shared/domain/domainobject'; -import { roleFactory, setupEntities, userDoFactory } from '@shared/testing'; +import { roleFactory, setupEntities, userDoFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { UserMigrationDatabaseOperationFailedLoggableException, diff --git a/apps/server/src/modules/user-login-migration/uc/close-user-login-migration.uc.spec.ts b/apps/server/src/modules/user-login-migration/uc/close-user-login-migration.uc.spec.ts index 4e99f03dc14..853cc9626a2 100644 --- a/apps/server/src/modules/user-login-migration/uc/close-user-login-migration.uc.spec.ts +++ b/apps/server/src/modules/user-login-migration/uc/close-user-login-migration.uc.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { UserLoginMigrationDO } from '@shared/domain/domainobject'; import { Permission } from '@shared/domain/interface'; -import { setupEntities, userFactory, userLoginMigrationDOFactory } from '@shared/testing'; +import { setupEntities, userFactory, userLoginMigrationDOFactory } from '@shared/testing/factory'; import { UserLoginMigrationNotFoundLoggableException } from '../loggable'; import { SchoolMigrationService, UserLoginMigrationRevertService, UserLoginMigrationService } from '../service'; import { CloseUserLoginMigrationUc } from './close-user-login-migration.uc'; diff --git a/apps/server/src/modules/user-login-migration/uc/restart-user-login-migration.uc.spec.ts b/apps/server/src/modules/user-login-migration/uc/restart-user-login-migration.uc.spec.ts index 14b05604707..1101a5b0e28 100644 --- a/apps/server/src/modules/user-login-migration/uc/restart-user-login-migration.uc.spec.ts +++ b/apps/server/src/modules/user-login-migration/uc/restart-user-login-migration.uc.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { UserLoginMigrationDO } from '@shared/domain/domainobject'; import { User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { setupEntities, userFactory, userLoginMigrationDOFactory } from '@shared/testing'; +import { setupEntities, userFactory, userLoginMigrationDOFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { UserLoginMigrationNotFoundLoggableException } from '../loggable'; import { SchoolMigrationService, UserLoginMigrationService } from '../service'; diff --git a/apps/server/src/modules/user-login-migration/uc/start-user-login-migration.uc.spec.ts b/apps/server/src/modules/user-login-migration/uc/start-user-login-migration.uc.spec.ts index 6ddaa59e9d4..53ee12ab56e 100644 --- a/apps/server/src/modules/user-login-migration/uc/start-user-login-migration.uc.spec.ts +++ b/apps/server/src/modules/user-login-migration/uc/start-user-login-migration.uc.spec.ts @@ -6,7 +6,12 @@ import { Test, TestingModule } from '@nestjs/testing'; import { LegacySchoolDo, UserLoginMigrationDO } from '@shared/domain/domainobject'; import { User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { legacySchoolDoFactory, setupEntities, userFactory, userLoginMigrationDOFactory } from '@shared/testing'; +import { + legacySchoolDoFactory, + setupEntities, + userFactory, + userLoginMigrationDOFactory, +} from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { SchoolNumberMissingLoggableException, UserLoginMigrationAlreadyClosedLoggableException } from '../loggable'; import { UserLoginMigrationService } from '../service'; diff --git a/apps/server/src/modules/user-login-migration/uc/toggle-user-login-migration.uc.spec.ts b/apps/server/src/modules/user-login-migration/uc/toggle-user-login-migration.uc.spec.ts index a970f654d9b..88d65b3059f 100644 --- a/apps/server/src/modules/user-login-migration/uc/toggle-user-login-migration.uc.spec.ts +++ b/apps/server/src/modules/user-login-migration/uc/toggle-user-login-migration.uc.spec.ts @@ -6,7 +6,12 @@ import { Test, TestingModule } from '@nestjs/testing'; import { LegacySchoolDo, UserLoginMigrationDO } from '@shared/domain/domainobject'; import { User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; -import { legacySchoolDoFactory, setupEntities, userFactory, userLoginMigrationDOFactory } from '@shared/testing'; +import { + legacySchoolDoFactory, + setupEntities, + userFactory, + userLoginMigrationDOFactory, +} from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { ObjectId } from '@mikro-orm/mongodb'; import { UserLoginMigrationNotFoundLoggableException } from '../loggable'; diff --git a/apps/server/src/modules/user-login-migration/uc/user-login-migration-rollback.uc.spec.ts b/apps/server/src/modules/user-login-migration/uc/user-login-migration-rollback.uc.spec.ts index b3497cafdbd..938b63d433d 100644 --- a/apps/server/src/modules/user-login-migration/uc/user-login-migration-rollback.uc.spec.ts +++ b/apps/server/src/modules/user-login-migration/uc/user-login-migration-rollback.uc.spec.ts @@ -3,7 +3,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { AuthorizationService } from '@modules/authorization'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; -import { setupEntities, userFactory } from '@shared/testing'; +import { setupEntities, userFactory } from '@shared/testing/factory'; import { UserLoginMigrationRollbackService } from '../service'; import { UserLoginMigrationRollbackUc } from './user-login-migration-rollback.uc'; diff --git a/apps/server/src/modules/user/controller/api-test/admin-api-user.api.spec.ts b/apps/server/src/modules/user/controller/api-test/admin-api-user.api.spec.ts index db04a062561..e636ab34e73 100644 --- a/apps/server/src/modules/user/controller/api-test/admin-api-user.api.spec.ts +++ b/apps/server/src/modules/user/controller/api-test/admin-api-user.api.spec.ts @@ -3,7 +3,7 @@ import { ExecutionContext, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { User } from '@shared/domain/entity'; import { RoleName } from '@shared/domain/interface'; -import { TestApiClient, schoolEntityFactory } from '@shared/testing'; +import { TestApiClient, schoolEntityFactory } from '@shared/testing/factory'; import { AccountEntity } from '@src/modules/account/domain/entity/account.entity'; import { AdminApiServerTestModule } from '@src/modules/server/admin-api.server.module'; import { nanoid } from 'nanoid'; diff --git a/apps/server/src/modules/user/controller/api-test/user-language.api.spec.ts b/apps/server/src/modules/user/controller/api-test/user-language.api.spec.ts index fb8cd5c4a83..387599435ae 100644 --- a/apps/server/src/modules/user/controller/api-test/user-language.api.spec.ts +++ b/apps/server/src/modules/user/controller/api-test/user-language.api.spec.ts @@ -8,7 +8,7 @@ import { ServerTestModule } from '@modules/server/server.module'; import { ApiValidationError } from '@shared/common'; import { User } from '@shared/domain/entity'; import { LanguageType } from '@shared/domain/interface'; -import { cleanupCollections, mapUserToCurrentUser, roleFactory, userFactory } from '@shared/testing'; +import { cleanupCollections, mapUserToCurrentUser, roleFactory, userFactory } from '@shared/testing/factory'; import { Request } from 'express'; import request from 'supertest'; diff --git a/apps/server/src/modules/user/controller/api-test/user-me.api.spec.ts b/apps/server/src/modules/user/controller/api-test/user-me.api.spec.ts index 9182109b3e2..95d03a02eb4 100644 --- a/apps/server/src/modules/user/controller/api-test/user-me.api.spec.ts +++ b/apps/server/src/modules/user/controller/api-test/user-me.api.spec.ts @@ -11,7 +11,7 @@ import { ServerTestModule } from '@modules/server/server.module'; import { ResolvedUserResponse } from '@modules/user/controller/dto'; import { ApiValidationError } from '@shared/common'; import { LanguageType } from '@shared/domain/interface'; -import { cleanupCollections, mapUserToCurrentUser, roleFactory, userFactory } from '@shared/testing'; +import { cleanupCollections, mapUserToCurrentUser, roleFactory, userFactory } from '@shared/testing/factory'; const baseRouteName = '/user/me'; diff --git a/apps/server/src/modules/user/legacy/repo/users-admin.repo.spec.ts b/apps/server/src/modules/user/legacy/repo/users-admin.repo.spec.ts index 60e87ec36d2..4bbe6b6a390 100644 --- a/apps/server/src/modules/user/legacy/repo/users-admin.repo.spec.ts +++ b/apps/server/src/modules/user/legacy/repo/users-admin.repo.spec.ts @@ -4,7 +4,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { Role, SchoolEntity, SchoolYearEntity, User } from '@shared/domain/entity'; import { Permission, RoleName } from '@shared/domain/interface'; -import { roleFactory, schoolEntityFactory, schoolYearFactory, userFactory } from '@shared/testing'; +import { roleFactory, schoolEntityFactory, schoolYearFactory, userFactory } from '@shared/testing/factory'; import { AccountEntity } from '@src/modules/account/domain/entity/account.entity'; import { accountFactory } from '@src/modules/account/testing'; import { classEntityFactory } from '../../../class/entity/testing'; @@ -169,7 +169,7 @@ describe('users admin repo', () => { const response = await repo.getUsersWithNestedData(studentRole.id, school.id, currentYear.id, query); const userListResponse = response as UserListResponse[]; - const data = userListResponse[0].data; + const { data } = userListResponse[0]; expect(userListResponse[0].total).toBe(2); expect(data.length).toBe(2); @@ -196,7 +196,7 @@ describe('users admin repo', () => { const response = await repo.getUsersWithNestedData(studentRole.id, school.id, currentYear.id, query); const userListResponse = response as UserListResponse[]; - const data = userListResponse[0].data; + const { data } = userListResponse[0]; expect(userListResponse[0].total).toBe(2); expect(data.length).toBe(2); @@ -221,7 +221,7 @@ describe('users admin repo', () => { const response = await repo.getUsersWithNestedData(studentRole.id, school.id, currentYear.id, query); const userListResponse = response as UserListResponse[]; - const data = userListResponse[0].data; + const { data } = userListResponse[0]; expect(userListResponse[0].total).toBe(2); expect(data.length).toBe(2); @@ -266,7 +266,7 @@ describe('users admin repo', () => { const response = await repo.getUsersWithNestedData(studentRole.id, school.id, currentYear.id, query); const userListResponse = response as UserListResponse[]; - const data = userListResponse[0].data; + const { data } = userListResponse[0]; expect(userListResponse[0].total).toBe(0); expect(data.length).toBe(0); @@ -291,7 +291,7 @@ describe('users admin repo', () => { const response = await repo.getUsersWithNestedData(studentRole.id, school.id, currentYear.id, query); const userListResponse = response as UserListResponse[]; - const data = userListResponse[0].data; + const { data } = userListResponse[0]; expect(data.length).toBe(0); expect(userListResponse[0].total).toBe(2); diff --git a/apps/server/src/modules/user/mapper/user.mapper.spec.ts b/apps/server/src/modules/user/mapper/user.mapper.spec.ts index afc6ff1e655..deb25c1be57 100644 --- a/apps/server/src/modules/user/mapper/user.mapper.spec.ts +++ b/apps/server/src/modules/user/mapper/user.mapper.spec.ts @@ -1,7 +1,7 @@ import { UserMapper } from '@modules/user/mapper/user.mapper'; import { UserDto } from '@modules/user/uc/dto/user.dto'; import { User } from '@shared/domain/entity'; -import { roleFactory, setupEntities, userFactory } from '@shared/testing'; +import { roleFactory, setupEntities, userFactory } from '@shared/testing/factory'; describe('UserMapper', () => { let userEntity: User; diff --git a/apps/server/src/modules/user/service/user.service.spec.ts b/apps/server/src/modules/user/service/user.service.spec.ts index 1a5766e743b..ac5818ee9b1 100644 --- a/apps/server/src/modules/user/service/user.service.spec.ts +++ b/apps/server/src/modules/user/service/user.service.spec.ts @@ -24,7 +24,7 @@ import { IFindOptions, LanguageType, Permission, RoleName, SortOrder } from '@sh import { EntityId } from '@shared/domain/types'; import { UserRepo } from '@shared/repo'; import { UserDORepo } from '@shared/repo/user/user-do.repo'; -import { roleFactory, setupEntities, userDoFactory, userFactory } from '@shared/testing'; +import { roleFactory, setupEntities, userDoFactory, userFactory } from '@shared/testing/factory'; import { Logger } from '@src/core/logger'; import { CalendarService } from '@src/infra/calendar'; import { UserDto } from '../uc/dto/user.dto'; diff --git a/apps/server/src/modules/user/uc/admin-api-user.uc.spec.ts b/apps/server/src/modules/user/uc/admin-api-user.uc.spec.ts index da8bb777ae4..a7f475d7a0f 100644 --- a/apps/server/src/modules/user/uc/admin-api-user.uc.spec.ts +++ b/apps/server/src/modules/user/uc/admin-api-user.uc.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { AccountService } from '@modules/account'; import { Test, TestingModule } from '@nestjs/testing'; import { RoleName } from '@shared/domain/interface'; -import { roleFactory, setupEntities, userDoFactory } from '@shared/testing'; +import { roleFactory, setupEntities, userDoFactory } from '@shared/testing/factory'; import { accountDoFactory } from '@src/modules/account/testing'; import { RoleService } from '@src/modules/role'; import { UserService } from '../service/user.service'; diff --git a/apps/server/src/modules/user/uc/user.uc.spec.ts b/apps/server/src/modules/user/uc/user.uc.spec.ts index 0bdd80a99f1..3031f095e8c 100644 --- a/apps/server/src/modules/user/uc/user.uc.spec.ts +++ b/apps/server/src/modules/user/uc/user.uc.spec.ts @@ -6,7 +6,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { User } from '@shared/domain/entity'; import { LanguageType, Permission } from '@shared/domain/interface'; import { UserRepo } from '@shared/repo'; -import { roleFactory, setupEntities, userFactory } from '@shared/testing'; +import { roleFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { UserUc } from './user.uc'; describe('UserUc', () => { diff --git a/apps/server/src/modules/video-conference/bbb/bbb.service.spec.ts b/apps/server/src/modules/video-conference/bbb/bbb.service.spec.ts index 1731d10ff8e..5ea5c6b397d 100644 --- a/apps/server/src/modules/video-conference/bbb/bbb.service.spec.ts +++ b/apps/server/src/modules/video-conference/bbb/bbb.service.spec.ts @@ -3,7 +3,7 @@ import { HttpService } from '@nestjs/axios'; import { InternalServerErrorException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { ConverterUtil } from '@shared/common'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { ErrorUtils } from '@src/core/error/utils'; import { AxiosResponse } from 'axios'; import crypto, { Hash } from 'crypto'; diff --git a/apps/server/src/modules/video-conference/service/video-conference.service.spec.ts b/apps/server/src/modules/video-conference/service/video-conference.service.spec.ts index d0daef948aa..47fb9907b5b 100644 --- a/apps/server/src/modules/video-conference/service/video-conference.service.spec.ts +++ b/apps/server/src/modules/video-conference/service/video-conference.service.spec.ts @@ -12,7 +12,7 @@ import { Course, TeamUserEntity } from '@shared/domain/entity'; import { Permission, RoleName, VideoConferenceScope } from '@shared/domain/interface'; import { EntityId, SchoolFeature } from '@shared/domain/types'; import { TeamsRepo, VideoConferenceRepo } from '@shared/repo'; -import { courseFactory, roleFactory, setupEntities, userDoFactory, userFactory } from '@shared/testing'; +import { courseFactory, roleFactory, setupEntities, userDoFactory, userFactory } from '@shared/testing/factory'; import { teamFactory } from '@shared/testing/factory/team.factory'; import { teamUserFactory } from '@shared/testing/factory/teamuser.factory'; import { videoConferenceDOFactory } from '@shared/testing/factory/video-conference.do.factory'; diff --git a/apps/server/src/modules/video-conference/uc/video-conference-create.uc.spec.ts b/apps/server/src/modules/video-conference/uc/video-conference-create.uc.spec.ts index 5af0215ba79..d0aceac4c69 100644 --- a/apps/server/src/modules/video-conference/uc/video-conference-create.uc.spec.ts +++ b/apps/server/src/modules/video-conference/uc/video-conference-create.uc.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { UserDO } from '@shared/domain/domainobject'; import {} from '@shared/domain/entity'; import { VideoConferenceScope } from '@shared/domain/interface'; -import { userDoFactory } from '@shared/testing'; +import { userDoFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { BBBCreateResponse, BBBMeetingInfoResponse, BBBResponse, BBBRole, BBBStatus } from '../bbb'; import { ErrorStatus } from '../error/error-status.enum'; diff --git a/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts b/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts index e4496406b9b..931c17d9ce0 100644 --- a/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts +++ b/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts @@ -14,7 +14,7 @@ import { Course, Role, TeamEntity } from '@shared/domain/entity'; import { Permission, RoleName, VideoConferenceScope } from '@shared/domain/interface'; import { EntityId } from '@shared/domain/types'; import { TeamsRepo, VideoConferenceRepo } from '@shared/repo'; -import { roleFactory, setupEntities, userDoFactory } from '@shared/testing'; +import { roleFactory, setupEntities, userDoFactory } from '@shared/testing/factory'; import { teamFactory } from '@shared/testing/factory/team.factory'; import { BBBBaseMeetingConfig, diff --git a/apps/server/src/modules/video-conference/uc/video-conference-end.uc.spec.ts b/apps/server/src/modules/video-conference/uc/video-conference-end.uc.spec.ts index ee552b35c17..52061b022db 100644 --- a/apps/server/src/modules/video-conference/uc/video-conference-end.uc.spec.ts +++ b/apps/server/src/modules/video-conference/uc/video-conference-end.uc.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { UserDO } from '@shared/domain/domainobject'; import {} from '@shared/domain/entity'; import { VideoConferenceScope } from '@shared/domain/interface'; -import { userDoFactory } from '@shared/testing'; +import { userDoFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { BBBBaseResponse, BBBResponse, BBBRole, BBBStatus } from '../bbb'; import { ErrorStatus } from '../error/error-status.enum'; diff --git a/apps/server/src/modules/video-conference/uc/video-conference-info.uc.spec.ts b/apps/server/src/modules/video-conference/uc/video-conference-info.uc.spec.ts index 4a9c7b77591..12542faeb0f 100644 --- a/apps/server/src/modules/video-conference/uc/video-conference-info.uc.spec.ts +++ b/apps/server/src/modules/video-conference/uc/video-conference-info.uc.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { UserDO, VideoConferenceDO } from '@shared/domain/domainobject'; import {} from '@shared/domain/entity'; import { Permission, VideoConferenceScope } from '@shared/domain/interface'; -import { userDoFactory } from '@shared/testing'; +import { userDoFactory } from '@shared/testing/factory'; import { videoConferenceDOFactory } from '@shared/testing/factory/video-conference.do.factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { BBBMeetingInfoResponse, BBBResponse, BBBRole, BBBStatus } from '../bbb'; diff --git a/apps/server/src/modules/video-conference/uc/video-conference-join.uc.spec.ts b/apps/server/src/modules/video-conference/uc/video-conference-join.uc.spec.ts index 655532d0cf2..c5912652268 100644 --- a/apps/server/src/modules/video-conference/uc/video-conference-join.uc.spec.ts +++ b/apps/server/src/modules/video-conference/uc/video-conference-join.uc.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { UserDO, VideoConferenceDO } from '@shared/domain/domainobject'; import {} from '@shared/domain/entity'; import { Permission, VideoConferenceScope } from '@shared/domain/interface'; -import { userDoFactory } from '@shared/testing'; +import { userDoFactory } from '@shared/testing/factory'; import { videoConferenceDOFactory } from '@shared/testing/factory/video-conference.do.factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { BBBJoinConfig, BBBJoinResponse, BBBResponse, BBBRole } from '../bbb'; diff --git a/apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.spec.ts index 379159ca791..ea2620fc44f 100644 --- a/apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.spec.ts +++ b/apps/server/src/shared/domain/domainobject/board/collaborative-text-editor-element.do.spec.ts @@ -1,5 +1,5 @@ import { createMock } from '@golevelup/ts-jest'; -import { collaborativeTextEditorElementFactory } from '@shared/testing'; +import { collaborativeTextEditorElementFactory } from '@shared/testing/factory'; import { CollaborativeTextEditorElement, isCollaborativeTextEditorElement, diff --git a/apps/server/src/shared/domain/domainobject/board/column-board.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/column-board.do.spec.ts index c56f9efa787..14020a86ab2 100644 --- a/apps/server/src/shared/domain/domainobject/board/column-board.do.spec.ts +++ b/apps/server/src/shared/domain/domainobject/board/column-board.do.spec.ts @@ -1,5 +1,5 @@ import { createMock } from '@golevelup/ts-jest'; -import { columnBoardFactory, columnFactory } from '@shared/testing'; +import { columnBoardFactory, columnFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { ColumnBoard } from './column-board.do'; import { BoardCompositeVisitor, BoardCompositeVisitorAsync, BoardExternalReferenceType } from './types'; diff --git a/apps/server/src/shared/domain/domainobject/board/column.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/column.do.spec.ts index 617023c4452..bf3ce55db28 100644 --- a/apps/server/src/shared/domain/domainobject/board/column.do.spec.ts +++ b/apps/server/src/shared/domain/domainobject/board/column.do.spec.ts @@ -1,5 +1,5 @@ import { createMock } from '@golevelup/ts-jest'; -import { cardFactory, columnFactory } from '@shared/testing'; +import { cardFactory, columnFactory } from '@shared/testing/factory'; import { Column } from './column.do'; import { BoardCompositeVisitor, BoardCompositeVisitorAsync } from './types'; diff --git a/apps/server/src/shared/domain/domainobject/board/external-tool-element.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/external-tool-element.do.spec.ts index 47fa813afba..11e48ce22bf 100644 --- a/apps/server/src/shared/domain/domainobject/board/external-tool-element.do.spec.ts +++ b/apps/server/src/shared/domain/domainobject/board/external-tool-element.do.spec.ts @@ -1,6 +1,6 @@ import { createMock } from '@golevelup/ts-jest'; import { ObjectId } from '@mikro-orm/mongodb'; -import { externalToolElementFactory } from '@shared/testing'; +import { externalToolElementFactory } from '@shared/testing/factory'; import { ExternalToolElement } from './external-tool-element.do'; import { BoardCompositeVisitor, BoardCompositeVisitorAsync } from './types'; diff --git a/apps/server/src/shared/domain/domainobject/board/file-element.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/file-element.do.spec.ts index 6de914f6751..93ef43ec924 100644 --- a/apps/server/src/shared/domain/domainobject/board/file-element.do.spec.ts +++ b/apps/server/src/shared/domain/domainobject/board/file-element.do.spec.ts @@ -1,5 +1,5 @@ import { createMock } from '@golevelup/ts-jest'; -import { fileElementFactory } from '@shared/testing'; +import { fileElementFactory } from '@shared/testing/factory'; import { FileElement } from './file-element.do'; import { BoardCompositeVisitor, BoardCompositeVisitorAsync } from './types'; diff --git a/apps/server/src/shared/domain/domainobject/board/link-element.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/link-element.do.spec.ts index 4a044e9be58..882a3f8bb88 100644 --- a/apps/server/src/shared/domain/domainobject/board/link-element.do.spec.ts +++ b/apps/server/src/shared/domain/domainobject/board/link-element.do.spec.ts @@ -1,5 +1,5 @@ import { createMock } from '@golevelup/ts-jest'; -import { linkElementFactory } from '@shared/testing'; +import { linkElementFactory } from '@shared/testing/factory'; import { LinkElement } from './link-element.do'; import { BoardCompositeVisitor, BoardCompositeVisitorAsync } from './types'; diff --git a/apps/server/src/shared/domain/domainobject/board/media-board/media-external-tool-element.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/media-board/media-external-tool-element.do.spec.ts index 7cb3da16522..6a4d12b47c1 100644 --- a/apps/server/src/shared/domain/domainobject/board/media-board/media-external-tool-element.do.spec.ts +++ b/apps/server/src/shared/domain/domainobject/board/media-board/media-external-tool-element.do.spec.ts @@ -1,4 +1,4 @@ -import { mediaExternalToolElementFactory } from '@shared/testing'; +import { mediaExternalToolElementFactory } from '@shared/testing/factory'; import { MediaExternalToolElement } from './media-external-tool-element.do'; describe(MediaExternalToolElement.name, () => { diff --git a/apps/server/src/shared/domain/domainobject/board/rich-text-element.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/rich-text-element.do.spec.ts index 7636c7ae872..f0bfb54edf6 100644 --- a/apps/server/src/shared/domain/domainobject/board/rich-text-element.do.spec.ts +++ b/apps/server/src/shared/domain/domainobject/board/rich-text-element.do.spec.ts @@ -1,5 +1,5 @@ import { createMock } from '@golevelup/ts-jest'; -import { richTextElementFactory } from '@shared/testing'; +import { richTextElementFactory } from '@shared/testing/factory'; import { RichTextElement } from './rich-text-element.do'; import { BoardCompositeVisitor, BoardCompositeVisitorAsync } from './types'; diff --git a/apps/server/src/shared/domain/domainobject/board/submission-container-element.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/submission-container-element.do.spec.ts index 0153f7777c2..2b5ae5c8c88 100644 --- a/apps/server/src/shared/domain/domainobject/board/submission-container-element.do.spec.ts +++ b/apps/server/src/shared/domain/domainobject/board/submission-container-element.do.spec.ts @@ -1,5 +1,5 @@ import { createMock } from '@golevelup/ts-jest'; -import { submissionContainerElementFactory, submissionItemFactory } from '@shared/testing'; +import { submissionContainerElementFactory, submissionItemFactory } from '@shared/testing/factory'; import { SubmissionContainerElement } from './submission-container-element.do'; import { BoardCompositeVisitor, BoardCompositeVisitorAsync } from './types'; diff --git a/apps/server/src/shared/domain/domainobject/board/submission-item.do.spec.ts b/apps/server/src/shared/domain/domainobject/board/submission-item.do.spec.ts index df7b4b6f95e..ff3496754f4 100644 --- a/apps/server/src/shared/domain/domainobject/board/submission-item.do.spec.ts +++ b/apps/server/src/shared/domain/domainobject/board/submission-item.do.spec.ts @@ -1,5 +1,5 @@ import { createMock } from '@golevelup/ts-jest'; -import { submissionContainerElementFactory, submissionItemFactory } from '@shared/testing'; +import { submissionContainerElementFactory, submissionItemFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { SubmissionItem } from './submission-item.do'; import { BoardCompositeVisitor, BoardCompositeVisitorAsync } from './types'; diff --git a/apps/server/src/shared/domain/entity/boardnode/file-element-node.entity.spec.ts b/apps/server/src/shared/domain/entity/boardnode/file-element-node.entity.spec.ts index 050cf255f73..b1f5efa015c 100644 --- a/apps/server/src/shared/domain/entity/boardnode/file-element-node.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/boardnode/file-element-node.entity.spec.ts @@ -1,5 +1,5 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; -import { fileElementFactory } from '@shared/testing'; +import { fileElementFactory } from '@shared/testing/factory'; import { FileElementNode } from './file-element-node.entity'; import { BoardDoBuilder, BoardNodeType } from './types'; diff --git a/apps/server/src/shared/domain/entity/boardnode/link-element-node.entity.spec.ts b/apps/server/src/shared/domain/entity/boardnode/link-element-node.entity.spec.ts index 1093e57922e..dd074b91974 100644 --- a/apps/server/src/shared/domain/entity/boardnode/link-element-node.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/boardnode/link-element-node.entity.spec.ts @@ -1,5 +1,5 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; -import { linkElementFactory } from '@shared/testing'; +import { linkElementFactory } from '@shared/testing/factory'; import { LinkElementNode } from './link-element-node.entity'; import { BoardDoBuilder, BoardNodeType } from './types'; diff --git a/apps/server/src/shared/domain/entity/boardnode/rich-text-element-node.entity.spec.ts b/apps/server/src/shared/domain/entity/boardnode/rich-text-element-node.entity.spec.ts index fdb7a691ca0..be4b110cda2 100644 --- a/apps/server/src/shared/domain/entity/boardnode/rich-text-element-node.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/boardnode/rich-text-element-node.entity.spec.ts @@ -1,6 +1,6 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { InputFormat } from '@shared/domain/types'; -import { richTextElementFactory } from '@shared/testing'; +import { richTextElementFactory } from '@shared/testing/factory'; import { RichTextElementNode } from './rich-text-element-node.entity'; import { BoardDoBuilder, BoardNodeType } from './types'; diff --git a/apps/server/src/shared/domain/entity/boardnode/submission-container-element-node.entity.spec.ts b/apps/server/src/shared/domain/entity/boardnode/submission-container-element-node.entity.spec.ts index 461277483fe..86b702f06ec 100644 --- a/apps/server/src/shared/domain/entity/boardnode/submission-container-element-node.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/boardnode/submission-container-element-node.entity.spec.ts @@ -1,5 +1,5 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; -import { submissionContainerElementFactory } from '@shared/testing'; +import { submissionContainerElementFactory } from '@shared/testing/factory'; import { SubmissionContainerElementNode } from './submission-container-element-node.entity'; import { BoardDoBuilder, BoardNodeType } from './types'; diff --git a/apps/server/src/shared/domain/entity/boardnode/submission-item-node.entity.spec.ts b/apps/server/src/shared/domain/entity/boardnode/submission-item-node.entity.spec.ts index ebf302861b2..f31d3c78e4d 100644 --- a/apps/server/src/shared/domain/entity/boardnode/submission-item-node.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/boardnode/submission-item-node.entity.spec.ts @@ -1,5 +1,5 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; -import { submissionItemFactory } from '@shared/testing'; +import { submissionItemFactory } from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { SubmissionItemNode } from './submission-item-node.entity'; import { BoardDoBuilder, BoardNodeType } from './types'; diff --git a/apps/server/src/shared/domain/entity/course.entity.spec.ts b/apps/server/src/shared/domain/entity/course.entity.spec.ts index 0b7f7f432eb..f52b4ebf3e0 100644 --- a/apps/server/src/shared/domain/entity/course.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/course.entity.spec.ts @@ -1,6 +1,12 @@ import { MikroORM } from '@mikro-orm/core'; import { InternalServerErrorException } from '@nestjs/common'; -import { courseFactory, courseGroupFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing'; +import { + courseFactory, + courseGroupFactory, + schoolEntityFactory, + setupEntities, + userFactory, +} from '@shared/testing/factory'; import { ObjectId } from '@mikro-orm/mongodb'; import { Course } from './course.entity'; import { CourseGroup } from './coursegroup.entity'; diff --git a/apps/server/src/shared/domain/entity/coursegroup.entity.spec.ts b/apps/server/src/shared/domain/entity/coursegroup.entity.spec.ts index 390457a4c87..7d4bca98936 100644 --- a/apps/server/src/shared/domain/entity/coursegroup.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/coursegroup.entity.spec.ts @@ -1,4 +1,4 @@ -import { courseFactory, courseGroupFactory, setupEntities, userFactory } from '@shared/testing'; +import { courseFactory, courseGroupFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { CourseGroup } from './coursegroup.entity'; describe('CourseGroupEntity', () => { diff --git a/apps/server/src/shared/domain/entity/import-user.entity.spec.ts b/apps/server/src/shared/domain/entity/import-user.entity.spec.ts index cdd22330733..2ed4a89512f 100644 --- a/apps/server/src/shared/domain/entity/import-user.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/import-user.entity.spec.ts @@ -1,4 +1,4 @@ -import { importUserFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing'; +import { importUserFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { MatchCreator } from '.'; describe('ImportUser entity', () => { diff --git a/apps/server/src/shared/domain/entity/legacy-board/boardElement.entity.spec.ts b/apps/server/src/shared/domain/entity/legacy-board/boardElement.entity.spec.ts index 1bdc4d8ed55..0e3a9450ada 100644 --- a/apps/server/src/shared/domain/entity/legacy-board/boardElement.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/legacy-board/boardElement.entity.spec.ts @@ -1,4 +1,4 @@ -import { columnBoardNodeFactory, lessonFactory, setupEntities, taskFactory } from '@shared/testing'; +import { columnBoardNodeFactory, lessonFactory, setupEntities, taskFactory } from '@shared/testing/factory'; import { LegacyBoardElementType } from './legacy-boardelement.entity'; import { ColumnboardBoardElement } from './column-board-boardelement'; import { LessonBoardElement } from './lesson-boardelement.entity'; diff --git a/apps/server/src/shared/domain/entity/news.entity.spec.ts b/apps/server/src/shared/domain/entity/news.entity.spec.ts index 36ced085831..31dfc1de72e 100644 --- a/apps/server/src/shared/domain/entity/news.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/news.entity.spec.ts @@ -1,4 +1,4 @@ -import { setupEntities, teamNewsFactory, userFactory } from '@shared/testing'; +import { setupEntities, teamNewsFactory, userFactory } from '@shared/testing/factory'; import { News } from './news.entity'; describe(News.name, () => { diff --git a/apps/server/src/shared/domain/entity/system.entity.spec.ts b/apps/server/src/shared/domain/entity/system.entity.spec.ts index 06c45b5c5e4..1bda93c403e 100644 --- a/apps/server/src/shared/domain/entity/system.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/system.entity.spec.ts @@ -1,5 +1,5 @@ import { SystemProvisioningStrategy } from '@shared/domain/interface/system-provisioning.strategy'; -import { setupEntities, systemEntityFactory } from '@shared/testing'; +import { setupEntities, systemEntityFactory } from '@shared/testing/factory'; import { SystemEntity } from './system.entity'; describe('System Entity', () => { diff --git a/apps/server/src/shared/domain/entity/user.entity.spec.ts b/apps/server/src/shared/domain/entity/user.entity.spec.ts index c12f0960475..ea01813cf98 100644 --- a/apps/server/src/shared/domain/entity/user.entity.spec.ts +++ b/apps/server/src/shared/domain/entity/user.entity.spec.ts @@ -2,7 +2,7 @@ import { Configuration } from '@hpi-schul-cloud/commons/lib'; import { MikroORM } from '@mikro-orm/core'; import { ObjectId } from '@mikro-orm/mongodb'; import { ReferenceNotPopulatedLoggableException } from '@shared/common/loggable-exception/reference-not-populated.loggable-exception'; -import { roleFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing'; +import { roleFactory, schoolEntityFactory, setupEntities, userFactory } from '@shared/testing/factory'; import { Role, SchoolEntity } from '.'; import { LanguageType, Permission, RoleName } from '../interface'; import { User } from './user.entity'; diff --git a/apps/server/src/shared/repo/contextexternaltool/context-external-tool.repo.integration.spec.ts b/apps/server/src/shared/repo/contextexternaltool/context-external-tool.repo.integration.spec.ts index 3f19a93f47b..0e539e5bcc9 100644 --- a/apps/server/src/shared/repo/contextexternaltool/context-external-tool.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/contextexternaltool/context-external-tool.repo.integration.spec.ts @@ -12,7 +12,7 @@ import { schoolExternalToolEntityFactory } from '@modules/tool/school-external-t import { Test, TestingModule } from '@nestjs/testing'; import { SchoolEntity } from '@shared/domain/entity'; import { ExternalToolRepoMapper } from '@shared/repo/externaltool/external-tool.repo.mapper'; -import { cleanupCollections, contextExternalToolFactory, schoolEntityFactory } from '@shared/testing'; +import { cleanupCollections, contextExternalToolFactory, schoolEntityFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { ContextExternalToolRepo } from './context-external-tool.repo'; diff --git a/apps/server/src/shared/repo/course/course.repo.integration.spec.ts b/apps/server/src/shared/repo/course/course.repo.integration.spec.ts index 128d742001d..504bae3dbf0 100644 --- a/apps/server/src/shared/repo/course/course.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/course/course.repo.integration.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Course } from '@shared/domain/entity'; import { SortOrder } from '@shared/domain/interface'; import { EntityId } from '@shared/domain/types'; -import { cleanupCollections, courseFactory, courseGroupFactory, userFactory } from '@shared/testing'; +import { cleanupCollections, courseFactory, courseGroupFactory, userFactory } from '@shared/testing/factory'; import { CourseRepo } from './course.repo'; const checkEqualIds = (arr1: { id: EntityId }[], arr2: { id: EntityId }[]): boolean => { diff --git a/apps/server/src/shared/repo/coursegroup/coursegroup.repo.integration.spec.ts b/apps/server/src/shared/repo/coursegroup/coursegroup.repo.integration.spec.ts index ccf48f9182f..42a03adbeaa 100644 --- a/apps/server/src/shared/repo/coursegroup/coursegroup.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/coursegroup/coursegroup.repo.integration.spec.ts @@ -3,7 +3,7 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { Course, CourseGroup } from '@shared/domain/entity'; import { EntityId } from '@shared/domain/types'; -import { courseFactory, courseGroupFactory } from '@shared/testing'; +import { courseFactory, courseGroupFactory } from '@shared/testing/factory'; import { CourseGroupRepo } from './coursegroup.repo'; const checkEqualIds = (arr1: { id: EntityId }[], arr2: { id: EntityId }[]): boolean => { diff --git a/apps/server/src/shared/repo/dashboard/dashboard.model.mapper.spec.ts b/apps/server/src/shared/repo/dashboard/dashboard.model.mapper.spec.ts index 9399da2542c..7407276653e 100644 --- a/apps/server/src/shared/repo/dashboard/dashboard.model.mapper.spec.ts +++ b/apps/server/src/shared/repo/dashboard/dashboard.model.mapper.spec.ts @@ -10,7 +10,7 @@ import { GridElement, } from '@shared/domain/entity'; import { LearnroomMetadata, LearnroomTypes } from '@shared/domain/types'; -import { courseFactory, userFactory } from '@shared/testing'; +import { courseFactory, userFactory } from '@shared/testing/factory'; import { DashboardModelMapper } from './dashboard.model.mapper'; describe('dashboard model mapper', () => { diff --git a/apps/server/src/shared/repo/dashboard/dashboard.repo.integration.spec.ts b/apps/server/src/shared/repo/dashboard/dashboard.repo.integration.spec.ts index 4f16c9c83cc..5f6f13f945a 100644 --- a/apps/server/src/shared/repo/dashboard/dashboard.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/dashboard/dashboard.repo.integration.spec.ts @@ -2,7 +2,7 @@ import { MongoMemoryDatabaseModule } from '@infra/database'; import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { DashboardEntity, DashboardGridElementModel, GridElement } from '@shared/domain/entity'; -import { courseFactory, userFactory } from '@shared/testing'; +import { courseFactory, userFactory } from '@shared/testing/factory'; import { DashboardModelMapper } from './dashboard.model.mapper'; import { DashboardRepo } from './dashboard.repo'; diff --git a/apps/server/src/shared/repo/dashboard/dashboardElement.repo.spec.ts b/apps/server/src/shared/repo/dashboard/dashboardElement.repo.spec.ts index 7c416193b2b..44eb430a72d 100644 --- a/apps/server/src/shared/repo/dashboard/dashboardElement.repo.spec.ts +++ b/apps/server/src/shared/repo/dashboard/dashboardElement.repo.spec.ts @@ -2,7 +2,7 @@ import { MongoMemoryDatabaseModule } from '@infra/database'; import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { DashboardGridElementModel, DashboardModelEntity } from '@shared/domain/entity'; -import { courseFactory, userFactory } from '@shared/testing'; +import { courseFactory, userFactory } from '@shared/testing/factory'; import { DashboardElementRepo } from './dashboardElement.repo'; describe(DashboardElementRepo.name, () => { diff --git a/apps/server/src/shared/repo/federalstate/federal-state.repo.spec.ts b/apps/server/src/shared/repo/federalstate/federal-state.repo.spec.ts index 7755eefb4b4..b8089bab971 100644 --- a/apps/server/src/shared/repo/federalstate/federal-state.repo.spec.ts +++ b/apps/server/src/shared/repo/federalstate/federal-state.repo.spec.ts @@ -2,7 +2,7 @@ import { MongoMemoryDatabaseModule } from '@infra/database'; import { EntityManager } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { FederalStateEntity } from '@shared/domain/entity'; -import { cleanupCollections, federalStateFactory } from '@shared/testing'; +import { cleanupCollections, federalStateFactory } from '@shared/testing/factory'; import { FederalStateRepo } from './federal-state.repo'; describe('FederalStateRepo', () => { diff --git a/apps/server/src/shared/repo/importuser/importuser.repo.integration.spec.ts b/apps/server/src/shared/repo/importuser/importuser.repo.integration.spec.ts index 9f70c446495..a8aa9a731d1 100644 --- a/apps/server/src/shared/repo/importuser/importuser.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/importuser/importuser.repo.integration.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { IImportUserRoleName, ImportUser, MatchCreator, SchoolEntity, User } from '@shared/domain/entity'; import { RoleName } from '@shared/domain/interface'; import { MatchCreatorScope } from '@shared/domain/types'; -import { cleanupCollections, importUserFactory, schoolEntityFactory, userFactory } from '@shared/testing'; +import { cleanupCollections, importUserFactory, schoolEntityFactory, userFactory } from '@shared/testing/factory'; import { ImportUserRepo } from '.'; describe('ImportUserRepo', () => { diff --git a/apps/server/src/shared/repo/role/role.repo.integration.spec.ts b/apps/server/src/shared/repo/role/role.repo.integration.spec.ts index 91b2a083fff..4a6b691dd44 100644 --- a/apps/server/src/shared/repo/role/role.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/role/role.repo.integration.spec.ts @@ -4,7 +4,7 @@ import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { Role } from '@shared/domain/entity'; import { RoleName } from '@shared/domain/interface'; -import { cleanupCollections, roleFactory } from '@shared/testing'; +import { cleanupCollections, roleFactory } from '@shared/testing/factory'; import { RoleRepo } from './role.repo'; describe('role repo', () => { diff --git a/apps/server/src/shared/repo/storageprovider/storageprovider.repo.spec.ts b/apps/server/src/shared/repo/storageprovider/storageprovider.repo.spec.ts index 6e71c3d1d93..d21ff156de7 100644 --- a/apps/server/src/shared/repo/storageprovider/storageprovider.repo.spec.ts +++ b/apps/server/src/shared/repo/storageprovider/storageprovider.repo.spec.ts @@ -2,7 +2,7 @@ import { MongoMemoryDatabaseModule } from '@infra/database'; import { EntityManager } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { StorageProviderEntity } from '@shared/domain/entity'; -import { cleanupCollections, storageProviderFactory } from '@shared/testing'; +import { cleanupCollections, storageProviderFactory } from '@shared/testing/factory'; import { StorageProviderRepo } from './storageprovider.repo'; describe('StorageProviderRepo', () => { diff --git a/apps/server/src/shared/repo/system/legacy-system.repo.integration.spec.ts b/apps/server/src/shared/repo/system/legacy-system.repo.integration.spec.ts index b8cc14a7311..ede595e1f71 100644 --- a/apps/server/src/shared/repo/system/legacy-system.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/system/legacy-system.repo.integration.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { SystemEntity } from '@shared/domain/entity'; import { SystemTypeEnum } from '@shared/domain/types'; import { LegacySystemRepo } from '@shared/repo'; -import { systemEntityFactory } from '@shared/testing'; +import { systemEntityFactory } from '@shared/testing/factory'; describe('system repo', () => { let module: TestingModule; diff --git a/apps/server/src/shared/repo/teams/team.repo.integration.spec.ts b/apps/server/src/shared/repo/teams/team.repo.integration.spec.ts index 3e6a07bbf66..c099008123f 100644 --- a/apps/server/src/shared/repo/teams/team.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/teams/team.repo.integration.spec.ts @@ -5,7 +5,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { TeamEntity, TeamUserEntity } from '@shared/domain/entity'; import { EntityId } from '@shared/domain/types'; import { TeamsRepo } from '@shared/repo'; -import { cleanupCollections, roleFactory } from '@shared/testing'; +import { cleanupCollections, roleFactory } from '@shared/testing/factory'; import { teamFactory } from '@shared/testing/factory/team.factory'; import { teamUserFactory } from '@shared/testing/factory/teamuser.factory'; diff --git a/apps/server/src/shared/repo/userloginmigration/user-login-migration.repo.integration.spec.ts b/apps/server/src/shared/repo/userloginmigration/user-login-migration.repo.integration.spec.ts index a762d3eeab2..1445a009918 100644 --- a/apps/server/src/shared/repo/userloginmigration/user-login-migration.repo.integration.spec.ts +++ b/apps/server/src/shared/repo/userloginmigration/user-login-migration.repo.integration.spec.ts @@ -6,7 +6,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { UserLoginMigrationDO } from '@shared/domain/domainobject'; import { SchoolEntity, SystemEntity } from '@shared/domain/entity'; import { UserLoginMigrationEntity } from '@shared/domain/entity/user-login-migration.entity'; -import { cleanupCollections, schoolEntityFactory, systemEntityFactory } from '@shared/testing'; +import { cleanupCollections, schoolEntityFactory, systemEntityFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; import { userLoginMigrationFactory } from '../../testing/factory/user-login-migration.factory'; import { UserLoginMigrationRepo } from './user-login-migration.repo'; diff --git a/apps/server/src/shared/testing/factory/axios-error.factory.ts b/apps/server/src/shared/testing/factory/axios-error.factory.ts index 089179dafef..f4699fbee06 100644 --- a/apps/server/src/shared/testing/factory/axios-error.factory.ts +++ b/apps/server/src/shared/testing/factory/axios-error.factory.ts @@ -1,5 +1,5 @@ import { HttpStatus } from '@nestjs/common'; -import { axiosResponseFactory } from '@shared/testing'; +import { axiosResponseFactory } from '@shared/testing/factory'; import { AxiosError, AxiosHeaders } from 'axios'; import { Factory } from 'fishery'; diff --git a/apps/server/src/shared/testing/factory/video-conference.do.factory.ts b/apps/server/src/shared/testing/factory/video-conference.do.factory.ts index 0ba97c5fa79..fb95aecc459 100644 --- a/apps/server/src/shared/testing/factory/video-conference.do.factory.ts +++ b/apps/server/src/shared/testing/factory/video-conference.do.factory.ts @@ -1,6 +1,6 @@ import { VideoConferenceDO } from '@shared/domain/domainobject'; import { VideoConferenceScope } from '@shared/domain/interface'; -import { BaseFactory } from '@shared/testing'; +import { BaseFactory } from '@shared/testing/factory'; export const videoConferenceDOFactory: BaseFactory = BaseFactory.define< VideoConferenceDO, diff --git a/apps/server/src/shared/testing/index.ts b/apps/server/src/shared/testing/index.ts index 9b968a2e8f7..f06c1283a65 100644 --- a/apps/server/src/shared/testing/index.ts +++ b/apps/server/src/shared/testing/index.ts @@ -1,4 +1,6 @@ -export * from './factory'; +// Note: This has to be removed to prevent import-cycles +// with factories under @modules +// export * from './factory'; export * from './setup-entities'; export * from './cleanup-collections'; export * from './map-user-to-current-user';