aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users/user-subscriptions.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-12-09 11:14:47 +0100
committerChocobozzz <me@florianbigard.com>2022-12-12 13:36:23 +0100
commit2732eeff9e6994582293b5aaa0cb158b7e272e9e (patch)
tree417d30cf470cd1db84e06c5dbd1b5429d4b99bc1 /server/tests/api/users/user-subscriptions.ts
parentc7c5f8d0f17b0ab598fbe237f11639c6de28110c (diff)
downloadPeerTube-2732eeff9e6994582293b5aaa0cb158b7e272e9e.tar.gz
PeerTube-2732eeff9e6994582293b5aaa0cb158b7e272e9e.tar.zst
PeerTube-2732eeff9e6994582293b5aaa0cb158b7e272e9e.zip
Fix CI using 127.0.0.1 for tests
Diffstat (limited to 'server/tests/api/users/user-subscriptions.ts')
-rw-r--r--server/tests/api/users/user-subscriptions.ts38
1 files changed, 19 insertions, 19 deletions
diff --git a/server/tests/api/users/user-subscriptions.ts b/server/tests/api/users/user-subscriptions.ts
index fbeca7d67..b45cfe67e 100644
--- a/server/tests/api/users/user-subscriptions.ts
+++ b/server/tests/api/users/user-subscriptions.ts
@@ -63,8 +63,8 @@ describe('Test users subscriptions', function () {
63 it('User of server 1 should follow user of server 3 and root of server 1', async function () { 63 it('User of server 1 should follow user of server 3 and root of server 1', async function () {
64 this.timeout(60000) 64 this.timeout(60000)
65 65
66 await command.add({ token: users[0].accessToken, targetUri: 'user3_channel@localhost:' + servers[2].port }) 66 await command.add({ token: users[0].accessToken, targetUri: 'user3_channel@' + servers[2].host })
67 await command.add({ token: users[0].accessToken, targetUri: 'root_channel@localhost:' + servers[0].port }) 67 await command.add({ token: users[0].accessToken, targetUri: 'root_channel@' + servers[0].host })
68 68
69 await waitJobs(servers) 69 await waitJobs(servers)
70 70
@@ -112,20 +112,20 @@ describe('Test users subscriptions', function () {
112 112
113 it('Should get subscription', async function () { 113 it('Should get subscription', async function () {
114 { 114 {
115 const videoChannel = await command.get({ token: users[0].accessToken, uri: 'user3_channel@localhost:' + servers[2].port }) 115 const videoChannel = await command.get({ token: users[0].accessToken, uri: 'user3_channel@' + servers[2].host })
116 116
117 expect(videoChannel.name).to.equal('user3_channel') 117 expect(videoChannel.name).to.equal('user3_channel')
118 expect(videoChannel.host).to.equal('localhost:' + servers[2].port) 118 expect(videoChannel.host).to.equal(servers[2].host)
119 expect(videoChannel.displayName).to.equal('Main user3 channel') 119 expect(videoChannel.displayName).to.equal('Main user3 channel')
120 expect(videoChannel.followingCount).to.equal(0) 120 expect(videoChannel.followingCount).to.equal(0)
121 expect(videoChannel.followersCount).to.equal(1) 121 expect(videoChannel.followersCount).to.equal(1)
122 } 122 }
123 123
124 { 124 {
125 const videoChannel = await command.get({ token: users[0].accessToken, uri: 'root_channel@localhost:' + servers[0].port }) 125 const videoChannel = await command.get({ token: users[0].accessToken, uri: 'root_channel@' + servers[0].host })
126 126
127 expect(videoChannel.name).to.equal('root_channel') 127 expect(videoChannel.name).to.equal('root_channel')
128 expect(videoChannel.host).to.equal('localhost:' + servers[0].port) 128 expect(videoChannel.host).to.equal(servers[0].host)
129 expect(videoChannel.displayName).to.equal('Main root channel') 129 expect(videoChannel.displayName).to.equal('Main root channel')
130 expect(videoChannel.followingCount).to.equal(0) 130 expect(videoChannel.followingCount).to.equal(0)
131 expect(videoChannel.followersCount).to.equal(1) 131 expect(videoChannel.followersCount).to.equal(1)
@@ -134,18 +134,18 @@ describe('Test users subscriptions', function () {
134 134
135 it('Should return the existing subscriptions', async function () { 135 it('Should return the existing subscriptions', async function () {
136 const uris = [ 136 const uris = [
137 'user3_channel@localhost:' + servers[2].port, 137 'user3_channel@' + servers[2].host,
138 'root2_channel@localhost:' + servers[0].port, 138 'root2_channel@' + servers[0].host,
139 'root_channel@localhost:' + servers[0].port, 139 'root_channel@' + servers[0].host,
140 'user3_channel@localhost:' + servers[0].port 140 'user3_channel@' + servers[0].host
141 ] 141 ]
142 142
143 const body = await command.exist({ token: users[0].accessToken, uris }) 143 const body = await command.exist({ token: users[0].accessToken, uris })
144 144
145 expect(body['user3_channel@localhost:' + servers[2].port]).to.be.true 145 expect(body['user3_channel@' + servers[2].host]).to.be.true
146 expect(body['root2_channel@localhost:' + servers[0].port]).to.be.false 146 expect(body['root2_channel@' + servers[0].host]).to.be.false
147 expect(body['root_channel@localhost:' + servers[0].port]).to.be.true 147 expect(body['root_channel@' + servers[0].host]).to.be.true
148 expect(body['user3_channel@localhost:' + servers[0].port]).to.be.false 148 expect(body['user3_channel@' + servers[0].host]).to.be.false
149 }) 149 })
150 150
151 it('Should search among subscriptions', async function () { 151 it('Should search among subscriptions', async function () {
@@ -305,7 +305,7 @@ describe('Test users subscriptions', function () {
305 it('Should remove user of server 3 subscription', async function () { 305 it('Should remove user of server 3 subscription', async function () {
306 this.timeout(30000) 306 this.timeout(30000)
307 307
308 await command.remove({ token: users[0].accessToken, uri: 'user3_channel@localhost:' + servers[2].port }) 308 await command.remove({ token: users[0].accessToken, uri: 'user3_channel@' + servers[2].host })
309 309
310 await waitJobs(servers) 310 await waitJobs(servers)
311 }) 311 })
@@ -324,7 +324,7 @@ describe('Test users subscriptions', function () {
324 it('Should remove the root subscription and not display the videos anymore', async function () { 324 it('Should remove the root subscription and not display the videos anymore', async function () {
325 this.timeout(30000) 325 this.timeout(30000)
326 326
327 await command.remove({ token: users[0].accessToken, uri: 'root_channel@localhost:' + servers[0].port }) 327 await command.remove({ token: users[0].accessToken, uri: 'root_channel@' + servers[0].host })
328 328
329 await waitJobs(servers) 329 await waitJobs(servers)
330 330
@@ -355,7 +355,7 @@ describe('Test users subscriptions', function () {
355 it('Should follow user of server 3 again', async function () { 355 it('Should follow user of server 3 again', async function () {
356 this.timeout(60000) 356 this.timeout(60000)
357 357
358 await command.add({ token: users[0].accessToken, targetUri: 'user3_channel@localhost:' + servers[2].port }) 358 await command.add({ token: users[0].accessToken, targetUri: 'user3_channel@' + servers[2].host })
359 359
360 await waitJobs(servers) 360 await waitJobs(servers)
361 361
@@ -389,8 +389,8 @@ describe('Test users subscriptions', function () {
389 389
390 await servers[2].channels.create({ token: users[2].accessToken, attributes: { name: 'user3_channel2' } }) 390 await servers[2].channels.create({ token: users[2].accessToken, attributes: { name: 'user3_channel2' } })
391 391
392 await servers[2].subscriptions.add({ token: servers[2].accessToken, targetUri: 'user3_channel@localhost:' + servers[2].port }) 392 await servers[2].subscriptions.add({ token: servers[2].accessToken, targetUri: 'user3_channel@' + servers[2].host })
393 await servers[2].subscriptions.add({ token: servers[2].accessToken, targetUri: 'user3_channel2@localhost:' + servers[2].port }) 393 await servers[2].subscriptions.add({ token: servers[2].accessToken, targetUri: 'user3_channel2@' + servers[2].host })
394 394
395 await waitJobs(servers) 395 await waitJobs(servers)
396 }) 396 })