X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fusers%2Fuser-subscriptions.ts;h=65b80540c858210367c2e93386a3ea18c6a67bd8;hb=f37dc0dd14d9ce0b59c454c2c1b935fcbe9727e9;hp=cb7d94b0b9aff80a983cc93f83626c672945802e;hpb=240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/users/user-subscriptions.ts b/server/tests/api/users/user-subscriptions.ts index cb7d94b0b..65b80540c 100644 --- a/server/tests/api/users/user-subscriptions.ts +++ b/server/tests/api/users/user-subscriptions.ts @@ -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)