From d0ce42c1c17054b7e0c5081243152c32ecb1c193 Mon Sep 17 00:00:00 2001 From: BRAINS YUM <43896676+McFlat@users.noreply.github.com> Date: Fri, 7 Dec 2018 07:54:33 -0600 Subject: username/display_name/video_channel_name min length 1 and max length 50 (#1265) * make username, display_name and video_channel_name min length 1 and max length 50; (fixes #1263); ! still some bug on the frontend complains but if you remove the disabled property it creates the account just fine; allow for usernames to start with a number; fix test, since username can be 1 char now make test check empty; fix test, Should fail with a too long username; fix test, Should fail with a too small username; fix regular expression for username and videoChannel; change username, videoChannel to be lowercase and fix message; * change 1 characters to 1 character --- server/tests/api/check-params/users.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/tests/api/check-params/users.ts') 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 () { } it('Should fail with a too small username', async function () { - const fields = immutableAssign(baseCorrectParams, { username: 'fi' }) + const fields = immutableAssign(baseCorrectParams, { username: '' }) await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) }) it('Should fail with a too long username', async function () { - const fields = immutableAssign(baseCorrectParams, { username: 'my_super_username_which_is_very_long' }) + const fields = immutableAssign(baseCorrectParams, { username: 'super'.repeat(11) }) await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) }) @@ -550,13 +550,13 @@ describe('Test users API validators', function () { } it('Should fail with a too small username', async function () { - const fields = immutableAssign(baseCorrectParams, { username: 'ji' }) + const fields = immutableAssign(baseCorrectParams, { username: '' }) await makePostBodyRequest({ url: server.url, path: registrationPath, token: server.accessToken, fields }) }) it('Should fail with a too long username', async function () { - const fields = immutableAssign(baseCorrectParams, { username: 'my_super_username_which_is_very_long' }) + const fields = immutableAssign(baseCorrectParams, { username: 'super'.repeat(11) }) await makePostBodyRequest({ url: server.url, path: registrationPath, token: server.accessToken, fields }) }) -- cgit v1.2.3