X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Ftests%2Fapi%2Fusers%2Fuser-subscriptions.ts;h=2fbda6828d1ca158e9240d7d00be16e491e4d592;hb=99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd;hp=ba59a9a608bd41906098af2c7ce5ec39202f354a;hpb=8a19bee1a1ee39f973bb37429e4f73c3f2873cdb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/users/user-subscriptions.ts b/server/tests/api/users/user-subscriptions.ts index ba59a9a60..2fbda6828 100644 --- a/server/tests/api/users/user-subscriptions.ts +++ b/server/tests/api/users/user-subscriptions.ts @@ -11,7 +11,8 @@ import { addUserSubscription, listUserSubscriptions, listUserSubscriptionVideos, - removeUserSubscription + removeUserSubscription, + getUserSubscription } from '../../utils/users/user-subscriptions' const expect = chai.expect @@ -101,6 +102,30 @@ describe('Test users subscriptions', function () { } }) + it('Should get subscription', async function () { + { + const res = await getUserSubscription(servers[ 0 ].url, users[ 0 ].accessToken, 'user3_channel@localhost:9003') + const videoChannel: VideoChannel = res.body + + expect(videoChannel.name).to.equal('user3_channel') + expect(videoChannel.host).to.equal('localhost:9003') + expect(videoChannel.displayName).to.equal('Main user3 channel') + expect(videoChannel.followingCount).to.equal(0) + expect(videoChannel.followersCount).to.equal(1) + } + + { + const res = await getUserSubscription(servers[ 0 ].url, users[ 0 ].accessToken, 'root_channel@localhost:9001') + const videoChannel: VideoChannel = res.body + + expect(videoChannel.name).to.equal('root_channel') + expect(videoChannel.host).to.equal('localhost:9001') + expect(videoChannel.displayName).to.equal('Main root channel') + expect(videoChannel.followingCount).to.equal(0) + expect(videoChannel.followersCount).to.equal(1) + } + }) + it('Should list subscription videos', async function () { { const res = await listUserSubscriptionVideos(servers[0].url, servers[0].accessToken)