From 310b5219b38427f0c2c7ba57225afdd8f3064380 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 8 Jul 2020 15:51:46 +0200 Subject: Add new abuses tests --- server/helpers/custom-validators/abuses.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/helpers/custom-validators/abuses.ts') diff --git a/server/helpers/custom-validators/abuses.ts b/server/helpers/custom-validators/abuses.ts index c21468caa..0ca06a252 100644 --- a/server/helpers/custom-validators/abuses.ts +++ b/server/helpers/custom-validators/abuses.ts @@ -3,10 +3,10 @@ import { AbuseFilter, abusePredefinedReasonsMap, AbusePredefinedReasonsString, A import { ABUSE_STATES, CONSTRAINTS_FIELDS } from '../../initializers/constants' import { exists, isArray } from './misc' -const VIDEO_ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.ABUSES +const ABUSES_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.ABUSES function isAbuseReasonValid (value: string) { - return exists(value) && validator.isLength(value, VIDEO_ABUSES_CONSTRAINTS_FIELDS.REASON) + return exists(value) && validator.isLength(value, ABUSES_CONSTRAINTS_FIELDS.REASON) } function isAbusePredefinedReasonValid (value: AbusePredefinedReasonsString) { @@ -32,7 +32,7 @@ function isAbuseTimestampCoherent (endAt: number, { req }) { } function isAbuseModerationCommentValid (value: string) { - return exists(value) && validator.isLength(value, VIDEO_ABUSES_CONSTRAINTS_FIELDS.MODERATION_COMMENT) + return exists(value) && validator.isLength(value, ABUSES_CONSTRAINTS_FIELDS.MODERATION_COMMENT) } function isAbuseStateValid (value: string) { -- cgit v1.2.3