X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Fusers.ts;h=13be8b4604638bb954f19882cc56c1d98a015a6e;hb=c100a6142e6571312db9f6407698a21a08b593fb;hp=f8044cbd4c910c4686d8de1e2cdbc752c05409cf;hpb=8b9a525a180cc9f3a98c334cc052dcfc8f36dcd4;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index f8044cbd4..13be8b460 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts @@ -464,6 +464,24 @@ describe('Test users API validators', function () { await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields }) }) + it('Should fail with a too small password', async function () { + const fields = { + currentPassword: 'my super password', + password: 'bla' + } + + await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields }) + }) + + it('Should fail with a too long password', async function () { + const fields = { + currentPassword: 'my super password', + password: 'super'.repeat(61) + } + + await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields }) + }) + it('Should fail with an non authenticated user', async function () { const fields = { videoQuota: 42 @@ -485,11 +503,10 @@ describe('Test users API validators', function () { email: 'email@example.com', emailVerified: true, videoQuota: 42, - role: UserRole.MODERATOR + role: UserRole.USER } await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields, statusCodeExpected: 204 }) - userAccessToken = await userLogin(server, user) }) })