+ expect(res.body.total).to.equal(2)
+ expect(res.body.data).to.have.lengthOf(2)
+
+ const videos: Video[] = res.body.data
+ const privateVideo = videos.find(v => v.name === 'private video becomes public')
+ const internalVideo = videos.find(v => v.name === 'internal video becomes public')
+
+ expect(privateVideo).to.not.be.undefined
+ expect(internalVideo).to.not.be.undefined
+
+ expect(new Date(privateVideo.publishedAt).getTime()).to.be.at.least(now)
+ // We don't change the publish date of internal videos
+ expect(new Date(internalVideo.publishedAt).getTime()).to.be.below(now)
+
+ expect(privateVideo.privacy.id).to.equal(VideoPrivacy.PUBLIC)
+ expect(internalVideo.privacy.id).to.equal(VideoPrivacy.PUBLIC)
+ }
+ })
+
+ it('Should set these videos as private and internal', async function () {
+ this.timeout(10000)
+
+ await updateVideo(servers[0].url, servers[0].accessToken, internalVideoId, { privacy: VideoPrivacy.PRIVATE })
+ await updateVideo(servers[0].url, servers[0].accessToken, privateVideoId, { privacy: VideoPrivacy.INTERNAL })
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ const res = await getVideosList(server.url)
+
+ expect(res.body.total).to.equal(0)
+ expect(res.body.data).to.have.lengthOf(0)
+ }
+
+ {
+ const res = await getMyVideos(servers[0].url, servers[0].accessToken, 0, 5)
+ const videos = res.body.data
+
+ expect(res.body.total).to.equal(3)
+ expect(videos).to.have.lengthOf(3)
+
+ const privateVideo = videos.find(v => v.name === 'private video becomes public')
+ const internalVideo = videos.find(v => v.name === 'internal video becomes public')
+
+ expect(privateVideo).to.not.be.undefined
+ expect(internalVideo).to.not.be.undefined