]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-channels.ts
Dissociate video file names and video uuid
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-channels.ts
index e7d9238dd4f8d3af1ca4b29f3add959c94f79dd1..367f99fdd6c6ea5c05c262a994126cf76182d440 100644 (file)
@@ -1,8 +1,7 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import * as chai from 'chai'
 import 'mocha'
-import { User, Video, VideoChannel, ViewsPerDate, VideoDetails } from '../../../../shared/index'
+import * as chai from 'chai'
 import {
   cleanupTests,
   createUser,
@@ -30,6 +29,7 @@ import {
   viewVideo
 } from '../../../../shared/extra-utils/index'
 import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
+import { User, Video, VideoChannel, VideoDetails } from '../../../../shared/index'
 
 const expect = chai.expect
 
@@ -421,6 +421,32 @@ describe('Test video channels', function () {
     expect(totoChannel.videosCount).to.equal(0)
   })
 
+  it('Should search among account video channels', async function () {
+    {
+      const res = await getAccountVideoChannelsList({
+        url: servers[0].url,
+        accountName: userInfo.account.name + '@' + userInfo.account.host,
+        search: 'root'
+      })
+      expect(res.body.total).to.equal(1)
+
+      const channels = res.body.data
+      expect(channels).to.have.lengthOf(1)
+    }
+
+    {
+      const res = await getAccountVideoChannelsList({
+        url: servers[0].url,
+        accountName: userInfo.account.name + '@' + userInfo.account.host,
+        search: 'does not exist'
+      })
+      expect(res.body.total).to.equal(0)
+
+      const channels = res.body.data
+      expect(channels).to.have.lengthOf(0)
+    }
+  })
+
   after(async function () {
     await cleanupTests(servers)
   })