diff options
Diffstat (limited to 'server/tests/api/users/user-subscriptions.ts')
-rw-r--r-- | server/tests/api/users/user-subscriptions.ts | 27 |
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 | ||
17 | const expect = chai.expect | 18 | const 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) |