diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/initializers/constants.ts | 6 | ||||
-rw-r--r-- | server/tests/api/check-params/users.ts | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 6b798875c..d4496bc34 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -300,9 +300,9 @@ const CONFIG = { | |||
300 | 300 | ||
301 | const CONSTRAINTS_FIELDS = { | 301 | const CONSTRAINTS_FIELDS = { |
302 | USERS: { | 302 | USERS: { |
303 | NAME: { min: 3, max: 120 }, // Length | 303 | NAME: { min: 1, max: 50 }, // Length |
304 | DESCRIPTION: { min: 3, max: 1000 }, // Length | 304 | DESCRIPTION: { min: 3, max: 1000 }, // Length |
305 | USERNAME: { min: 3, max: 20 }, // Length | 305 | USERNAME: { min: 1, max: 50 }, // Length |
306 | PASSWORD: { min: 6, max: 255 }, // Length | 306 | PASSWORD: { min: 6, max: 255 }, // Length |
307 | VIDEO_QUOTA: { min: -1 }, | 307 | VIDEO_QUOTA: { min: -1 }, |
308 | VIDEO_QUOTA_DAILY: { min: -1 }, | 308 | VIDEO_QUOTA_DAILY: { min: -1 }, |
@@ -316,7 +316,7 @@ const CONSTRAINTS_FIELDS = { | |||
316 | REASON: { min: 2, max: 300 } // Length | 316 | REASON: { min: 2, max: 300 } // Length |
317 | }, | 317 | }, |
318 | VIDEO_CHANNELS: { | 318 | VIDEO_CHANNELS: { |
319 | NAME: { min: 3, max: 120 }, // Length | 319 | NAME: { min: 1, max: 50 }, // Length |
320 | DESCRIPTION: { min: 3, max: 1000 }, // Length | 320 | DESCRIPTION: { min: 3, max: 1000 }, // Length |
321 | SUPPORT: { min: 3, max: 1000 }, // Length | 321 | SUPPORT: { min: 3, max: 1000 }, // Length |
322 | URL: { min: 3, max: 2000 } // Length | 322 | URL: { min: 3, max: 2000 } // Length |
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 273be1679..ee225dc2e 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts | |||
@@ -99,13 +99,13 @@ describe('Test users API validators', function () { | |||
99 | } | 99 | } |
100 | 100 | ||
101 | it('Should fail with a too small username', async function () { | 101 | it('Should fail with a too small username', async function () { |
102 | const fields = immutableAssign(baseCorrectParams, { username: 'fi' }) | 102 | const fields = immutableAssign(baseCorrectParams, { username: '' }) |
103 | 103 | ||
104 | await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) | 104 | await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) |
105 | }) | 105 | }) |
106 | 106 | ||
107 | it('Should fail with a too long username', async function () { | 107 | it('Should fail with a too long username', async function () { |
108 | const fields = immutableAssign(baseCorrectParams, { username: 'my_super_username_which_is_very_long' }) | 108 | const fields = immutableAssign(baseCorrectParams, { username: 'super'.repeat(11) }) |
109 | 109 | ||
110 | await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) | 110 | await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) |
111 | }) | 111 | }) |
@@ -550,13 +550,13 @@ describe('Test users API validators', function () { | |||
550 | } | 550 | } |
551 | 551 | ||
552 | it('Should fail with a too small username', async function () { | 552 | it('Should fail with a too small username', async function () { |
553 | const fields = immutableAssign(baseCorrectParams, { username: 'ji' }) | 553 | const fields = immutableAssign(baseCorrectParams, { username: '' }) |
554 | 554 | ||
555 | await makePostBodyRequest({ url: server.url, path: registrationPath, token: server.accessToken, fields }) | 555 | await makePostBodyRequest({ url: server.url, path: registrationPath, token: server.accessToken, fields }) |
556 | }) | 556 | }) |
557 | 557 | ||
558 | it('Should fail with a too long username', async function () { | 558 | it('Should fail with a too long username', async function () { |
559 | const fields = immutableAssign(baseCorrectParams, { username: 'my_super_username_which_is_very_long' }) | 559 | const fields = immutableAssign(baseCorrectParams, { username: 'super'.repeat(11) }) |
560 | 560 | ||
561 | await makePostBodyRequest({ url: server.url, path: registrationPath, token: server.accessToken, fields }) | 561 | await makePostBodyRequest({ url: server.url, path: registrationPath, token: server.accessToken, fields }) |
562 | }) | 562 | }) |