diff --git a/apps/api/src/environment/dto/create.environment/create.environment.ts b/apps/api/src/environment/dto/create.environment/create.environment.ts index ffa62e3f..ae2b7db8 100644 --- a/apps/api/src/environment/dto/create.environment/create.environment.ts +++ b/apps/api/src/environment/dto/create.environment/create.environment.ts @@ -3,7 +3,6 @@ import { IsNotEmpty, IsOptional, IsString, Matches } from 'class-validator' export class CreateEnvironment { @IsString() @IsNotEmpty() - @Matches(/^[a-zA-Z0-9-_]{1,64}$/) name: string @IsString() diff --git a/apps/api/src/environment/environment.e2e.spec.ts b/apps/api/src/environment/environment.e2e.spec.ts index ad949f1c..607705ef 100644 --- a/apps/api/src/environment/environment.e2e.spec.ts +++ b/apps/api/src/environment/environment.e2e.spec.ts @@ -28,6 +28,7 @@ import { UserModule } from '@/user/user.module' import { UserService } from '@/user/service/user.service' import { QueryTransformPipe } from '@/common/pipes/query.transform.pipe' import { fetchEvents } from '@/common/event' +import { ValidationPipe } from '@nestjs/common' describe('Environment Controller Tests', () => { let app: NestFastifyApplication @@ -65,7 +66,7 @@ describe('Environment Controller Tests', () => { environmentService = moduleRef.get(EnvironmentService) userService = moduleRef.get(UserService) - app.useGlobalPipes(new QueryTransformPipe()) + app.useGlobalPipes(new ValidationPipe(), new QueryTransformPipe()) await app.init() await app.getHttpAdapter().getInstance().ready() @@ -184,7 +185,7 @@ describe('Environment Controller Tests', () => { 'x-e2e-user-email': user1.email } }) - + expect(response.statusCode).toBe(400) expect(response.json().message).toContain('name should not be empty') })