diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-31 15:20:35 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-31 15:32:10 +0100 |
commit | 11474c3cd904fa0fc07fc0a3a9a35496da17f300 (patch) | |
tree | 945bb2cdc11548c80706dbf7f0db4fa0edabbee0 /server/tests/api/single-pod.ts | |
parent | fd45e8f43c2638478599ca75632518054461da85 (diff) | |
download | PeerTube-11474c3cd904fa0fc07fc0a3a9a35496da17f300.tar.gz PeerTube-11474c3cd904fa0fc07fc0a3a9a35496da17f300.tar.zst PeerTube-11474c3cd904fa0fc07fc0a3a9a35496da17f300.zip |
Add tests and fix bugs for video privacy
Diffstat (limited to 'server/tests/api/single-pod.ts')
-rw-r--r-- | server/tests/api/single-pod.ts | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/server/tests/api/single-pod.ts b/server/tests/api/single-pod.ts index d3a982436..3a05d0727 100644 --- a/server/tests/api/single-pod.ts +++ b/server/tests/api/single-pod.ts | |||
@@ -22,6 +22,7 @@ import { | |||
22 | getVideoCategories, | 22 | getVideoCategories, |
23 | getVideoLicences, | 23 | getVideoLicences, |
24 | getVideoLanguages, | 24 | getVideoLanguages, |
25 | getVideoPrivacies, | ||
25 | testVideoImage, | 26 | testVideoImage, |
26 | webtorrentAdd, | 27 | webtorrentAdd, |
27 | getVideo, | 28 | getVideo, |
@@ -76,6 +77,15 @@ describe('Test a single pod', function () { | |||
76 | expect(languages[3]).to.equal('Mandarin') | 77 | expect(languages[3]).to.equal('Mandarin') |
77 | }) | 78 | }) |
78 | 79 | ||
80 | it('Should list video privacies', async function () { | ||
81 | const res = await getVideoPrivacies(server.url) | ||
82 | |||
83 | const privacies = res.body | ||
84 | expect(Object.keys(privacies)).to.have.length.at.least(3) | ||
85 | |||
86 | expect(privacies[3]).to.equal('Private') | ||
87 | }) | ||
88 | |||
79 | it('Should not have videos', async function () { | 89 | it('Should not have videos', async function () { |
80 | const res = await getVideosList(server.url) | 90 | const res = await getVideosList(server.url) |
81 | 91 | ||
@@ -482,19 +492,6 @@ describe('Test a single pod', function () { | |||
482 | // }) | 492 | // }) |
483 | // }) | 493 | // }) |
484 | 494 | ||
485 | it('Should search the right magnetUri video', async function () { | ||
486 | const video = videosListBase[0] | ||
487 | const res = await getVideo(server.url, video.id) | ||
488 | const videoDetails = res.body | ||
489 | |||
490 | const res2 = await searchVideoWithPagination(server.url, encodeURIComponent(videoDetails.files[0].magnetUri), 'magnetUri', 0, 15) | ||
491 | |||
492 | const videos = res2.body.data | ||
493 | expect(res2.body.total).to.equal(1) | ||
494 | expect(videos.length).to.equal(1) | ||
495 | expect(videos[0].name).to.equal(video.name) | ||
496 | }) | ||
497 | |||
498 | it('Should list and sort by name in descending order', async function () { | 495 | it('Should list and sort by name in descending order', async function () { |
499 | const res = await getVideosListSort(server.url, '-name') | 496 | const res = await getVideosListSort(server.url, '-name') |
500 | 497 | ||