From 01de67b9a4fcdf01102ccc3cb7dc24beebf6c7ea Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 3 Jan 2018 11:10:40 +0100 Subject: Add avatar max size limit --- server/tests/api/check-params/users.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (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 33d92ac24..14fcf8703 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts @@ -276,6 +276,14 @@ describe('Test users API validators', function () { await makePostUploadRequest({ url: server.url, path: path + '/me/avatar/pick', token: server.accessToken, fields, attaches }) }) + it('Should fail with a big file', async function () { + const fields = {} + const attaches = { + 'avatarfile': join(__dirname, '..', 'fixtures', 'avatar-big.png') + } + await makePostUploadRequest({ url: server.url, path: path + '/me/avatar/pick', token: server.accessToken, fields, attaches }) + }) + it('Should succeed with the correct params', async function () { const fields = {} const attaches = { -- cgit v1.2.3