]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/users/user-subscriptions.ts
Add ability to search video channels
[github/Chocobozzz/PeerTube.git] / server / tests / api / users / user-subscriptions.ts
index cb7d94b0b9aff80a983cc93f83626c672945802e..65b80540c858210367c2e93386a3ea18c6a67bd8 100644 (file)
@@ -12,7 +12,7 @@ import {
   listUserSubscriptions,
   listUserSubscriptionVideos,
   removeUserSubscription,
-  getUserSubscription
+  getUserSubscription, areSubscriptionsExist
 } from '../../utils/users/user-subscriptions'
 
 const expect = chai.expect
@@ -128,6 +128,23 @@ describe('Test users subscriptions', function () {
     }
   })
 
+  it('Should return the existing subscriptions', async function () {
+    const uris = [
+      'user3_channel@localhost:9003',
+      'root2_channel@localhost:9001',
+      'root_channel@localhost:9001',
+      'user3_channel@localhost:9001'
+    ]
+
+    const res = await areSubscriptionsExist(servers[ 0 ].url, users[ 0 ].accessToken, uris)
+    const body = res.body
+
+    expect(body['user3_channel@localhost:9003']).to.be.true
+    expect(body['root2_channel@localhost:9001']).to.be.false
+    expect(body['root_channel@localhost:9001']).to.be.true
+    expect(body['user3_channel@localhost:9001']).to.be.false
+  })
+
   it('Should list subscription videos', async function () {
     {
       const res = await listUserSubscriptionVideos(servers[0].url, servers[0].accessToken)