aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users/user-subscriptions.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:04:35 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit89d241a79c262b9775c233b73cff080043ebb5e6 (patch)
treecb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tests/api/users/user-subscriptions.ts
parentd23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff)
downloadPeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip
Shorter server command names
Diffstat (limited to 'server/tests/api/users/user-subscriptions.ts')
-rw-r--r--server/tests/api/users/user-subscriptions.ts34
1 files changed, 17 insertions, 17 deletions
diff --git a/server/tests/api/users/user-subscriptions.ts b/server/tests/api/users/user-subscriptions.ts
index 622cddb7d..1b15a98dc 100644
--- a/server/tests/api/users/user-subscriptions.ts
+++ b/server/tests/api/users/user-subscriptions.ts
@@ -35,26 +35,26 @@ describe('Test users subscriptions', function () {
35 { 35 {
36 for (const server of servers) { 36 for (const server of servers) {
37 const user = { username: 'user' + server.serverNumber, password: 'password' } 37 const user = { username: 'user' + server.serverNumber, password: 'password' }
38 await server.usersCommand.create({ username: user.username, password: user.password }) 38 await server.users.create({ username: user.username, password: user.password })
39 39
40 const accessToken = await server.loginCommand.getAccessToken(user) 40 const accessToken = await server.login.getAccessToken(user)
41 users.push({ accessToken }) 41 users.push({ accessToken })
42 42
43 const videoName1 = 'video 1-' + server.serverNumber 43 const videoName1 = 'video 1-' + server.serverNumber
44 await server.videosCommand.upload({ token: accessToken, attributes: { name: videoName1 } }) 44 await server.videos.upload({ token: accessToken, attributes: { name: videoName1 } })
45 45
46 const videoName2 = 'video 2-' + server.serverNumber 46 const videoName2 = 'video 2-' + server.serverNumber
47 await server.videosCommand.upload({ token: accessToken, attributes: { name: videoName2 } }) 47 await server.videos.upload({ token: accessToken, attributes: { name: videoName2 } })
48 } 48 }
49 } 49 }
50 50
51 await waitJobs(servers) 51 await waitJobs(servers)
52 52
53 command = servers[0].subscriptionsCommand 53 command = servers[0].subscriptions
54 }) 54 })
55 55
56 it('Should display videos of server 2 on server 1', async function () { 56 it('Should display videos of server 2 on server 1', async function () {
57 const { total } = await servers[0].videosCommand.list() 57 const { total } = await servers[0].videos.list()
58 58
59 expect(total).to.equal(4) 59 expect(total).to.equal(4)
60 }) 60 })
@@ -67,14 +67,14 @@ describe('Test users subscriptions', function () {
67 67
68 await waitJobs(servers) 68 await waitJobs(servers)
69 69
70 const { uuid } = await servers[2].videosCommand.upload({ attributes: { name: 'video server 3 added after follow' } }) 70 const { uuid } = await servers[2].videos.upload({ attributes: { name: 'video server 3 added after follow' } })
71 video3UUID = uuid 71 video3UUID = uuid
72 72
73 await waitJobs(servers) 73 await waitJobs(servers)
74 }) 74 })
75 75
76 it('Should not display videos of server 3 on server 1', async function () { 76 it('Should not display videos of server 3 on server 1', async function () {
77 const { total, data } = await servers[0].videosCommand.list() 77 const { total, data } = await servers[0].videos.list()
78 expect(total).to.equal(4) 78 expect(total).to.equal(4)
79 79
80 for (const video of data) { 80 for (const video of data) {
@@ -183,7 +183,7 @@ describe('Test users subscriptions', function () {
183 this.timeout(60000) 183 this.timeout(60000)
184 184
185 const videoName = 'video server 1 added after follow' 185 const videoName = 'video server 1 added after follow'
186 await servers[0].videosCommand.upload({ attributes: { name: videoName } }) 186 await servers[0].videos.upload({ attributes: { name: videoName } })
187 187
188 await waitJobs(servers) 188 await waitJobs(servers)
189 189
@@ -209,7 +209,7 @@ describe('Test users subscriptions', function () {
209 } 209 }
210 210
211 { 211 {
212 const { data, total } = await servers[0].videosCommand.list() 212 const { data, total } = await servers[0].videos.list()
213 expect(total).to.equal(5) 213 expect(total).to.equal(5)
214 214
215 for (const video of data) { 215 for (const video of data) {
@@ -223,11 +223,11 @@ describe('Test users subscriptions', function () {
223 it('Should have server 1 follow server 3 and display server 3 videos', async function () { 223 it('Should have server 1 follow server 3 and display server 3 videos', async function () {
224 this.timeout(60000) 224 this.timeout(60000)
225 225
226 await servers[0].followsCommand.follow({ targets: [ servers[2].url ] }) 226 await servers[0].follows.follow({ targets: [ servers[2].url ] })
227 227
228 await waitJobs(servers) 228 await waitJobs(servers)
229 229
230 const { data, total } = await servers[0].videosCommand.list() 230 const { data, total } = await servers[0].videos.list()
231 expect(total).to.equal(8) 231 expect(total).to.equal(8)
232 232
233 const names = [ '1-3', '2-3', 'video server 3 added after follow' ] 233 const names = [ '1-3', '2-3', 'video server 3 added after follow' ]
@@ -240,11 +240,11 @@ describe('Test users subscriptions', function () {
240 it('Should remove follow server 1 -> server 3 and hide server 3 videos', async function () { 240 it('Should remove follow server 1 -> server 3 and hide server 3 videos', async function () {
241 this.timeout(60000) 241 this.timeout(60000)
242 242
243 await servers[0].followsCommand.unfollow({ target: servers[2] }) 243 await servers[0].follows.unfollow({ target: servers[2] })
244 244
245 await waitJobs(servers) 245 await waitJobs(servers)
246 246
247 const { total, data } = await servers[0].videosCommand.list() 247 const { total, data } = await servers[0].videos.list()
248 expect(total).to.equal(5) 248 expect(total).to.equal(5)
249 249
250 for (const video of data) { 250 for (const video of data) {
@@ -280,7 +280,7 @@ describe('Test users subscriptions', function () {
280 it('Should update a video of server 3 and see the updated video on server 1', async function () { 280 it('Should update a video of server 3 and see the updated video on server 1', async function () {
281 this.timeout(30000) 281 this.timeout(30000)
282 282
283 await servers[2].videosCommand.update({ id: video3UUID, attributes: { name: 'video server 3 added after follow updated' } }) 283 await servers[2].videos.update({ id: video3UUID, attributes: { name: 'video server 3 added after follow updated' } })
284 284
285 await waitJobs(servers) 285 await waitJobs(servers)
286 286
@@ -325,7 +325,7 @@ describe('Test users subscriptions', function () {
325 }) 325 })
326 326
327 it('Should correctly display public videos on server 1', async function () { 327 it('Should correctly display public videos on server 1', async function () {
328 const { total, data } = await servers[0].videosCommand.list() 328 const { total, data } = await servers[0].videos.list()
329 expect(total).to.equal(5) 329 expect(total).to.equal(5)
330 330
331 for (const video of data) { 331 for (const video of data) {
@@ -356,7 +356,7 @@ describe('Test users subscriptions', function () {
356 } 356 }
357 357
358 { 358 {
359 const { total, data } = await servers[0].videosCommand.list() 359 const { total, data } = await servers[0].videos.list()
360 expect(total).to.equal(5) 360 expect(total).to.equal(5)
361 361
362 for (const video of data) { 362 for (const video of data) {