]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-description.ts
Add ability to remove hls/webtorrent files
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-description.ts
index 6ac9206f584171700446f36e9d7ff7d7d0f47bcd..d22b4ed962370414982f1ae51d6820a026f3bc44 100644 (file)
@@ -2,12 +2,12 @@
 
 import 'mocha'
 import * as chai from 'chai'
-import { cleanupTests, doubleFollow, flushAndRunMultipleServers, ServerInfo, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
+import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
 
 const expect = chai.expect
 
 describe('Test video description', function () {
-  let servers: ServerInfo[] = []
+  let servers: PeerTubeServer[] = []
   let videoUUID = ''
   let videoId: number
   const longDescription = 'my super description for server 1'.repeat(50)
@@ -16,7 +16,7 @@ describe('Test video description', function () {
     this.timeout(40000)
 
     // Run servers
-    servers = await flushAndRunMultipleServers(2)
+    servers = await createMultipleServers(2)
 
     // Get the access tokens
     await setAccessTokensToServers(servers)
@@ -31,11 +31,11 @@ describe('Test video description', function () {
     const attributes = {
       description: longDescription
     }
-    await servers[0].videosCommand.upload({ attributes })
+    await servers[0].videos.upload({ attributes })
 
     await waitJobs(servers)
 
-    const { data } = await servers[0].videosCommand.list()
+    const { data } = await servers[0].videos.list()
 
     videoId = data[0].id
     videoUUID = data[0].uuid
@@ -43,7 +43,7 @@ describe('Test video description', function () {
 
   it('Should have a truncated description on each server', async function () {
     for (const server of servers) {
-      const video = await server.videosCommand.get({ id: videoUUID })
+      const video = await server.videos.get({ id: videoUUID })
 
       // 30 characters * 6 -> 240 characters
       const truncatedDescription = 'my super description for server 1'.repeat(7) +
@@ -55,9 +55,9 @@ describe('Test video description', function () {
 
   it('Should fetch long description on each server', async function () {
     for (const server of servers) {
-      const video = await server.videosCommand.get({ id: videoUUID })
+      const video = await server.videos.get({ id: videoUUID })
 
-      const { description } = await server.videosCommand.getDescription({ descriptionPath: video.descriptionPath })
+      const { description } = await server.videos.getDescription({ descriptionPath: video.descriptionPath })
       expect(description).to.equal(longDescription)
     }
   })
@@ -68,18 +68,18 @@ describe('Test video description', function () {
     const attributes = {
       description: 'short description'
     }
-    await servers[0].videosCommand.update({ id: videoId, attributes })
+    await servers[0].videos.update({ id: videoId, attributes })
 
     await waitJobs(servers)
   })
 
   it('Should have a small description on each server', async function () {
     for (const server of servers) {
-      const video = await server.videosCommand.get({ id: videoUUID })
+      const video = await server.videos.get({ id: videoUUID })
 
       expect(video.description).to.equal('short description')
 
-      const { description } = await server.videosCommand.getDescription({ descriptionPath: video.descriptionPath })
+      const { description } = await server.videos.getDescription({ descriptionPath: video.descriptionPath })
       expect(description).to.equal('short description')
     }
   })