]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-privacy.ts
Add gitlab ci support
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-privacy.ts
index a823993b2d67761b0a17af5af591c3ae26bcd8f8..40b539106b2ec4fa8b7bffc17789347c51ec6dff 100644 (file)
@@ -4,9 +4,9 @@ import * as chai from 'chai'
 import 'mocha'
 import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
 import {
+  cleanupTests,
   flushAndRunMultipleServers,
-  getVideosList,
-  killallServers,
+  getVideosList, getVideosListWithToken,
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
@@ -152,7 +152,30 @@ describe('Test video privacy', function () {
     }
   })
 
-  after(function () {
-    killallServers(servers)
+  it('Should set this new video as private', async function () {
+    this.timeout(10000)
+
+    await updateVideo(servers[0].url, servers[0].accessToken, privateVideoId, { privacy: VideoPrivacy.PRIVATE })
+
+    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)
+
+      expect(res.body.total).to.equal(1)
+      expect(res.body.data).to.have.lengthOf(1)
+      expect(res.body.data[0].name).to.equal('super video public')
+    }
+  })
+
+  after(async function () {
+    await cleanupTests(servers)
   })
 })