]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-channels.ts
Don't rely on youtube for tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-channels.ts
index 3493a723d41693a01e0b58f28a185eee31efaae5..367f99fdd6c6ea5c05c262a994126cf76182d440 100644 (file)
@@ -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)
   })