]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-captions.ts
Add runner server tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-captions.ts
index 4c8e28adf25a0ae5e4be22c0ea19eb7cc6e71d6e..0630c9d3a70bdd96c08ab73796e0775ee91b2735 100644 (file)
@@ -1,20 +1,16 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
+import { checkVideoFilesWereRemoved, testCaptionFile } from '@server/tests/shared'
+import { wait } from '@shared/core-utils'
 import {
-  checkVideoFilesWereRemoved,
   cleanupTests,
   createMultipleServers,
   doubleFollow,
   PeerTubeServer,
   setAccessTokensToServers,
-  testCaptionFile,
-  wait,
   waitJobs
-} from '@shared/extra-utils'
-
-const expect = chai.expect
+} from '@shared/server-commands'
 
 describe('Test video captions', function () {
   const uuidRegex = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
@@ -178,9 +174,12 @@ describe('Test video captions', function () {
   })
 
   it('Should remove the video, and thus all video captions', async function () {
+    const video = await servers[0].videos.get({ id: videoUUID })
+    const { data: captions } = await servers[0].captions.list({ videoId: videoUUID })
+
     await servers[0].videos.remove({ id: videoUUID })
 
-    await checkVideoFilesWereRemoved(videoUUID, servers[0])
+    await checkVideoFilesWereRemoved({ server: servers[0], video, captions })
   })
 
   after(async function () {