diff options
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/check-params/users.ts | 9 | ||||
-rw-r--r-- | server/tests/api/users.ts | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 1e3533bf3..72488e5c4 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts | |||
@@ -350,6 +350,14 @@ describe('Test users API validators', function () { | |||
350 | await makePutBodyRequest({ url: server.url, path: path + 'me', token: userAccessToken, fields }) | 350 | await makePutBodyRequest({ url: server.url, path: path + 'me', token: userAccessToken, fields }) |
351 | }) | 351 | }) |
352 | 352 | ||
353 | it('Should fail with an invalid autoPlayVideo attribute', async function () { | ||
354 | const fields = { | ||
355 | autoPlayVideo: -1 | ||
356 | } | ||
357 | |||
358 | await makePutBodyRequest({ url: server.url, path: path + 'me', token: userAccessToken, fields }) | ||
359 | }) | ||
360 | |||
353 | it('Should fail with an non authenticated user', async function () { | 361 | it('Should fail with an non authenticated user', async function () { |
354 | const fields = { | 362 | const fields = { |
355 | password: 'my super password' | 363 | password: 'my super password' |
@@ -362,6 +370,7 @@ describe('Test users API validators', function () { | |||
362 | const fields = { | 370 | const fields = { |
363 | password: 'my super password', | 371 | password: 'my super password', |
364 | displayNSFW: true, | 372 | displayNSFW: true, |
373 | autoPlayVideo: false, | ||
365 | email: 'super_email@example.com' | 374 | email: 'super_email@example.com' |
366 | } | 375 | } |
367 | 376 | ||
diff --git a/server/tests/api/users.ts b/server/tests/api/users.ts index b3163b1e1..67e4cc8c6 100644 --- a/server/tests/api/users.ts +++ b/server/tests/api/users.ts | |||
@@ -415,6 +415,15 @@ describe('Test users', function () { | |||
415 | .a('number') | 415 | .a('number') |
416 | }) | 416 | }) |
417 | 417 | ||
418 | it('Should be able to change the autoPlayVideo attribute', async function () { | ||
419 | await updateMyUser(server.url, accessTokenUser, undefined, undefined, undefined, false) | ||
420 | |||
421 | const res = await getMyUserInformation(server.url, accessTokenUser) | ||
422 | const user = res.body | ||
423 | |||
424 | expect(user.autoPlayVideo).to.be.false | ||
425 | }) | ||
426 | |||
418 | it('Should be able to change the email display attribute', async function () { | 427 | it('Should be able to change the email display attribute', async function () { |
419 | await updateMyUser(server.url, accessTokenUser, undefined, undefined, 'updated@example.com') | 428 | await updateMyUser(server.url, accessTokenUser, undefined, undefined, 'updated@example.com') |
420 | 429 | ||