From d23e6a1c97a6ae3ca8d340a8c9adad268a5be57e Mon Sep 17 00:00:00 2001 From: BRAINS YUM <43896676+McFlat@users.noreply.github.com> Date: Fri, 19 Oct 2018 01:54:01 -0500 Subject: Feature/description support fields length 1000 (#1267) * fix migrations to not use config constant values as it can introduce bugs later when they change; (fixes #1259) remove constant fields imports from migrations * add migrations to update description and support fields to 1000 (fixes #1258) * fix client/server account and video_channel description/support fields to be max len 1000 (fixes #1258); fix test Should fail with a too long description; fix test Should fail with a long description; fix test Should fail with a long description; Remove USER.SUPPORT from constants since that field no longer exists; null not false, in migrations/0280-description-support.ts; video support field 1000, oops; * rename migration 0280-description-support.ts -> 0285-description-support.ts; update video support maxlength text --- server/tests/api/check-params/users.ts | 2 +- server/tests/api/check-params/video-channels.ts | 8 ++++---- server/tests/api/check-params/video-imports.ts | 2 +- server/tests/api/check-params/videos.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'server/tests/api') diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index cbfa0c137..ec46609a4 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts @@ -315,7 +315,7 @@ describe('Test users API validators', function () { it('Should fail with a too long description', async function () { const fields = { - description: 'super'.repeat(60) + description: 'super'.repeat(201) } await makePutBodyRequest({ url: server.url, path: path + 'me', token: userAccessToken, fields }) diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts index 3a7942945..e5696224d 100644 --- a/server/tests/api/check-params/video-channels.ts +++ b/server/tests/api/check-params/video-channels.ts @@ -118,12 +118,12 @@ describe('Test video channels API validator', function () { }) it('Should fail with a long description', async function () { - const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(150) }) + const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(201) }) await makePostBodyRequest({ url: server.url, path: videoChannelPath, token: server.accessToken, fields }) }) it('Should fail with a long support text', async function () { - const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(150) }) + const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) }) await makePostBodyRequest({ url: server.url, path: videoChannelPath, token: server.accessToken, fields }) }) @@ -185,12 +185,12 @@ describe('Test video channels API validator', function () { }) it('Should fail with a long description', async function () { - const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(150) }) + const fields = immutableAssign(baseCorrectParams, { description: 'super'.repeat(201) }) await makePutBodyRequest({ url: server.url, path, token: server.accessToken, fields }) }) it('Should fail with a long support text', async function () { - const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(150) }) + const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) }) await makePutBodyRequest({ url: server.url, path, token: server.accessToken, fields }) }) diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts index 44645b0e2..b51f3d2cd 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts @@ -140,7 +140,7 @@ describe('Test video imports API validator', function () { }) it('Should fail with a long support text', async function () { - const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(150) }) + const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) }) await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) }) diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 904d22870..699f135c7 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts @@ -233,7 +233,7 @@ describe('Test videos API validator', function () { }) it('Should fail with a long support text', async function () { - const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(150) }) + const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) }) const attaches = baseCorrectAttaches await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) @@ -482,7 +482,7 @@ describe('Test videos API validator', function () { }) it('Should fail with a long support text', async function () { - const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(150) }) + const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) }) await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) }) -- cgit v1.2.3