aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users/user-subscriptions.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-21 10:34:18 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 09:41:54 +0200
commit99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd (patch)
treee442f6cdf0cb622cb78f64d0d9de23bfb6deb951 /server/tests/api/users/user-subscriptions.ts
parent8a19bee1a1ee39f973bb37429e4f73c3f2873cdb (diff)
downloadPeerTube-99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd.tar.gz
PeerTube-99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd.tar.zst
PeerTube-99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd.zip
Add get subscription endpoint
Diffstat (limited to 'server/tests/api/users/user-subscriptions.ts')
-rw-r--r--server/tests/api/users/user-subscriptions.ts27
1 files changed, 26 insertions, 1 deletions
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 {
11 addUserSubscription, 11 addUserSubscription,
12 listUserSubscriptions, 12 listUserSubscriptions,
13 listUserSubscriptionVideos, 13 listUserSubscriptionVideos,
14 removeUserSubscription 14 removeUserSubscription,
15 getUserSubscription
15} from '../../utils/users/user-subscriptions' 16} from '../../utils/users/user-subscriptions'
16 17
17const expect = chai.expect 18const expect = chai.expect
@@ -101,6 +102,30 @@ describe('Test users subscriptions', function () {
101 } 102 }
102 }) 103 })
103 104
105 it('Should get subscription', async function () {
106 {
107 const res = await getUserSubscription(servers[ 0 ].url, users[ 0 ].accessToken, 'user3_channel@localhost:9003')
108 const videoChannel: VideoChannel = res.body
109
110 expect(videoChannel.name).to.equal('user3_channel')
111 expect(videoChannel.host).to.equal('localhost:9003')
112 expect(videoChannel.displayName).to.equal('Main user3 channel')
113 expect(videoChannel.followingCount).to.equal(0)
114 expect(videoChannel.followersCount).to.equal(1)
115 }
116
117 {
118 const res = await getUserSubscription(servers[ 0 ].url, users[ 0 ].accessToken, 'root_channel@localhost:9001')
119 const videoChannel: VideoChannel = res.body
120
121 expect(videoChannel.name).to.equal('root_channel')
122 expect(videoChannel.host).to.equal('localhost:9001')
123 expect(videoChannel.displayName).to.equal('Main root channel')
124 expect(videoChannel.followingCount).to.equal(0)
125 expect(videoChannel.followersCount).to.equal(1)
126 }
127 })
128
104 it('Should list subscription videos', async function () { 129 it('Should list subscription videos', async function () {
105 { 130 {
106 const res = await listUserSubscriptionVideos(servers[0].url, servers[0].accessToken) 131 const res = await listUserSubscriptionVideos(servers[0].url, servers[0].accessToken)