diff options
author | LoveIsGrief <LoveIsGrief@users.noreply.github.com> | 2019-09-24 08:48:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-09-24 08:48:01 +0200 |
commit | 6aa541481390980f9c85d2e66514ba0e6ce77a35 (patch) | |
tree | 7b2e934647a732645c69e5d05e4b18152b50a6b8 /server/tests/api | |
parent | 32d7f2b754b8d20bf44ae2121c79570cbff973c3 (diff) | |
download | PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.tar.gz PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.tar.zst PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.zip |
Autoplay next recommended video (#2137)
* Start working on autoplay of next video
* Ignore changes made by gitpod
* Apply changes from PR#1370
* Correct the spelling of recommendations
* Fix linting errors
* Move boolean check to existing onEnded handler
* Pick a random video until the recommendations are improved
* Add simple tests for autoPlayNextVideo
* Fix lint
...again
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/check-params/users.ts | 8 | ||||
-rw-r--r-- | server/tests/api/users/users.ts | 13 |
2 files changed, 21 insertions, 0 deletions
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 9d7ff8984..5d5af284c 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts | |||
@@ -418,6 +418,14 @@ describe('Test users API validators', function () { | |||
418 | await makePutBodyRequest({ url: server.url, path: path + 'me', token: userAccessToken, fields }) | 418 | await makePutBodyRequest({ url: server.url, path: path + 'me', token: userAccessToken, fields }) |
419 | }) | 419 | }) |
420 | 420 | ||
421 | it('Should fail with an invalid autoPlayNextVideo attribute', async function () { | ||
422 | const fields = { | ||
423 | autoPlayNextVideo: -1 | ||
424 | } | ||
425 | |||
426 | await makePutBodyRequest({ url: server.url, path: path + 'me', token: userAccessToken, fields }) | ||
427 | }) | ||
428 | |||
421 | it('Should fail with an invalid videosHistoryEnabled attribute', async function () { | 429 | it('Should fail with an invalid videosHistoryEnabled attribute', async function () { |
422 | const fields = { | 430 | const fields = { |
423 | videosHistoryEnabled: -1 | 431 | videosHistoryEnabled: -1 |
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 95b1bb626..ca06942e7 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -481,6 +481,19 @@ describe('Test users', function () { | |||
481 | expect(user.autoPlayVideo).to.be.false | 481 | expect(user.autoPlayVideo).to.be.false |
482 | }) | 482 | }) |
483 | 483 | ||
484 | it('Should be able to change the autoPlayNextVideo attribute', async function () { | ||
485 | await updateMyUser({ | ||
486 | url: server.url, | ||
487 | accessToken: accessTokenUser, | ||
488 | autoPlayNextVideo: true | ||
489 | }) | ||
490 | |||
491 | const res = await getMyUserInformation(server.url, accessTokenUser) | ||
492 | const user = res.body | ||
493 | |||
494 | expect(user.autoPlayNextVideo).to.be.true | ||
495 | }) | ||
496 | |||
484 | it('Should be able to change the email attribute', async function () { | 497 | it('Should be able to change the email attribute', async function () { |
485 | await updateMyUser({ | 498 | await updateMyUser({ |
486 | url: server.url, | 499 | url: server.url, |