aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/notifications
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/notifications')
-rw-r--r--server/tests/api/notifications/admin-notifications.ts2
-rw-r--r--server/tests/api/notifications/comments-notifications.ts4
-rw-r--r--server/tests/api/notifications/moderation-notifications.ts14
-rw-r--r--server/tests/api/notifications/notifications-api.ts2
-rw-r--r--server/tests/api/notifications/user-notifications.ts16
5 files changed, 19 insertions, 19 deletions
diff --git a/server/tests/api/notifications/admin-notifications.ts b/server/tests/api/notifications/admin-notifications.ts
index 07c981a37..6f059f622 100644
--- a/server/tests/api/notifications/admin-notifications.ts
+++ b/server/tests/api/notifications/admin-notifications.ts
@@ -31,7 +31,7 @@ describe('Test admin notifications', function () {
31 peertube: { 31 peertube: {
32 check_latest_version: { 32 check_latest_version: {
33 enabled: true, 33 enabled: true,
34 url: `http://localhost:${port}/versions.json` 34 url: `http://127.0.0.1:${port}/versions.json`
35 } 35 }
36 }, 36 },
37 plugins: { 37 plugins: {
diff --git a/server/tests/api/notifications/comments-notifications.ts b/server/tests/api/notifications/comments-notifications.ts
index 8b8c5712a..5a50af040 100644
--- a/server/tests/api/notifications/comments-notifications.ts
+++ b/server/tests/api/notifications/comments-notifications.ts
@@ -257,7 +257,7 @@ describe('Test comments notifications', function () {
257 257
258 await waitJobs(servers) 258 await waitJobs(servers)
259 259
260 const text1 = `hello @user_1@localhost:${servers[0].port} 1` 260 const text1 = `hello @user_1@${servers[0].host} 1`
261 const { id: server2ThreadId } = await servers[1].comments.createThread({ videoId: uuid, text: text1 }) 261 const { id: server2ThreadId } = await servers[1].comments.createThread({ videoId: uuid, text: text1 })
262 262
263 await waitJobs(servers) 263 await waitJobs(servers)
@@ -269,7 +269,7 @@ describe('Test comments notifications', function () {
269 const threadId = data[0].id 269 const threadId = data[0].id
270 await checkCommentMention({ ...baseParams, shortUUID, commentId: threadId, threadId, byAccountDisplayName, checkType: 'presence' }) 270 await checkCommentMention({ ...baseParams, shortUUID, commentId: threadId, threadId, byAccountDisplayName, checkType: 'presence' })
271 271
272 const text2 = `@user_1@localhost:${servers[0].port} hello 2 @root@localhost:${servers[0].port}` 272 const text2 = `@user_1@${servers[0].host} hello 2 @root@${servers[0].host}`
273 await servers[1].comments.addReply({ videoId: uuid, toCommentId: server2ThreadId, text: text2 }) 273 await servers[1].comments.addReply({ videoId: uuid, toCommentId: server2ThreadId, text: text2 })
274 274
275 await waitJobs(servers) 275 await waitJobs(servers)
diff --git a/server/tests/api/notifications/moderation-notifications.ts b/server/tests/api/notifications/moderation-notifications.ts
index 5a632fb22..b127a7a31 100644
--- a/server/tests/api/notifications/moderation-notifications.ts
+++ b/server/tests/api/notifications/moderation-notifications.ts
@@ -373,7 +373,7 @@ describe('Test moderation notifications', function () {
373 followings: { 373 followings: {
374 instance: { 374 instance: {
375 autoFollowIndex: { 375 autoFollowIndex: {
376 indexUrl: `http://localhost:${port}/api/v1/instances/hosts`, 376 indexUrl: `http://127.0.0.1:${port}/api/v1/instances/hosts`,
377 enabled: true 377 enabled: true
378 } 378 }
379 } 379 }
@@ -388,10 +388,10 @@ describe('Test moderation notifications', function () {
388 388
389 await waitJobs(servers) 389 await waitJobs(servers)
390 390
391 await checkNewInstanceFollower({ ...baseParams, followerHost: 'localhost:' + servers[2].port, checkType: 'presence' }) 391 await checkNewInstanceFollower({ ...baseParams, followerHost: servers[2].host, checkType: 'presence' })
392 392
393 const userOverride = { socketNotifications: userNotifications, token: userToken1, check: { web: true, mail: false } } 393 const userOverride = { socketNotifications: userNotifications, token: userToken1, check: { web: true, mail: false } }
394 await checkNewInstanceFollower({ ...baseParams, ...userOverride, followerHost: 'localhost:' + servers[2].port, checkType: 'absence' }) 394 await checkNewInstanceFollower({ ...baseParams, ...userOverride, followerHost: servers[2].host, checkType: 'absence' })
395 }) 395 })
396 396
397 it('Should send a notification on auto follow back', async function () { 397 it('Should send a notification on auto follow back', async function () {
@@ -495,8 +495,8 @@ describe('Test moderation notifications', function () {
495 autoBlacklistTestsCustomConfig.transcoding.enabled = true 495 autoBlacklistTestsCustomConfig.transcoding.enabled = true
496 await servers[0].config.updateCustomConfig({ newCustomConfig: autoBlacklistTestsCustomConfig }) 496 await servers[0].config.updateCustomConfig({ newCustomConfig: autoBlacklistTestsCustomConfig })
497 497
498 await servers[0].subscriptions.add({ targetUri: 'user_1_channel@localhost:' + servers[0].port }) 498 await servers[0].subscriptions.add({ targetUri: 'user_1_channel@' + servers[0].host })
499 await servers[1].subscriptions.add({ targetUri: 'user_1_channel@localhost:' + servers[0].port }) 499 await servers[1].subscriptions.add({ targetUri: 'user_1_channel@' + servers[0].host })
500 }) 500 })
501 501
502 it('Should send notification to moderators on new video with auto-blacklist', async function () { 502 it('Should send notification to moderators on new video with auto-blacklist', async function () {
@@ -615,8 +615,8 @@ describe('Test moderation notifications', function () {
615 after(async () => { 615 after(async () => {
616 await servers[0].config.updateCustomConfig({ newCustomConfig: currentCustomConfig }) 616 await servers[0].config.updateCustomConfig({ newCustomConfig: currentCustomConfig })
617 617
618 await servers[0].subscriptions.remove({ uri: 'user_1_channel@localhost:' + servers[0].port }) 618 await servers[0].subscriptions.remove({ uri: 'user_1_channel@' + servers[0].host })
619 await servers[1].subscriptions.remove({ uri: 'user_1_channel@localhost:' + servers[0].port }) 619 await servers[1].subscriptions.remove({ uri: 'user_1_channel@' + servers[0].host })
620 }) 620 })
621 }) 621 })
622 622
diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.ts
index f194656c9..1fc861160 100644
--- a/server/tests/api/notifications/notifications-api.ts
+++ b/server/tests/api/notifications/notifications-api.ts
@@ -26,7 +26,7 @@ describe('Test notifications API', function () {
26 userNotifications = res.userNotifications 26 userNotifications = res.userNotifications
27 server = res.servers[0] 27 server = res.servers[0]
28 28
29 await server.subscriptions.add({ token: userToken, targetUri: 'root_channel@localhost:' + server.port }) 29 await server.subscriptions.add({ token: userToken, targetUri: 'root_channel@' + server.host })
30 30
31 for (let i = 0; i < 10; i++) { 31 for (let i = 0; i < 10; i++) {
32 await server.videos.randomUpload({ wait: false }) 32 await server.videos.randomUpload({ wait: false })
diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts
index ceadc21ff..c6087b1eb 100644
--- a/server/tests/api/notifications/user-notifications.ts
+++ b/server/tests/api/notifications/user-notifications.ts
@@ -69,7 +69,7 @@ describe('Test user notifications', function () {
69 it('Should send a new video notification if the user follows the local video publisher', async function () { 69 it('Should send a new video notification if the user follows the local video publisher', async function () {
70 this.timeout(15000) 70 this.timeout(15000)
71 71
72 await servers[0].subscriptions.add({ token: userAccessToken, targetUri: 'root_channel@localhost:' + servers[0].port }) 72 await servers[0].subscriptions.add({ token: userAccessToken, targetUri: 'root_channel@' + servers[0].host })
73 await waitJobs(servers) 73 await waitJobs(servers)
74 74
75 const { name, shortUUID } = await uploadRandomVideoOnServers(servers, 1) 75 const { name, shortUUID } = await uploadRandomVideoOnServers(servers, 1)
@@ -79,7 +79,7 @@ describe('Test user notifications', function () {
79 it('Should send a new video notification from a remote account', async function () { 79 it('Should send a new video notification from a remote account', async function () {
80 this.timeout(150000) // Server 2 has transcoding enabled 80 this.timeout(150000) // Server 2 has transcoding enabled
81 81
82 await servers[0].subscriptions.add({ token: userAccessToken, targetUri: 'root_channel@localhost:' + servers[1].port }) 82 await servers[0].subscriptions.add({ token: userAccessToken, targetUri: 'root_channel@' + servers[1].host })
83 await waitJobs(servers) 83 await waitJobs(servers)
84 84
85 const { name, shortUUID } = await uploadRandomVideoOnServers(servers, 2) 85 const { name, shortUUID } = await uploadRandomVideoOnServers(servers, 2)
@@ -509,7 +509,7 @@ describe('Test user notifications', function () {
509 it('Should notify when a local channel is following one of our channel', async function () { 509 it('Should notify when a local channel is following one of our channel', async function () {
510 this.timeout(50000) 510 this.timeout(50000)
511 511
512 await servers[0].subscriptions.add({ targetUri: 'user_1_channel@localhost:' + servers[0].port }) 512 await servers[0].subscriptions.add({ targetUri: 'user_1_channel@' + servers[0].host })
513 await waitJobs(servers) 513 await waitJobs(servers)
514 514
515 await checkNewActorFollow({ 515 await checkNewActorFollow({
@@ -521,13 +521,13 @@ describe('Test user notifications', function () {
521 checkType: 'presence' 521 checkType: 'presence'
522 }) 522 })
523 523
524 await servers[0].subscriptions.remove({ uri: 'user_1_channel@localhost:' + servers[0].port }) 524 await servers[0].subscriptions.remove({ uri: 'user_1_channel@' + servers[0].host })
525 }) 525 })
526 526
527 it('Should notify when a remote channel is following one of our channel', async function () { 527 it('Should notify when a remote channel is following one of our channel', async function () {
528 this.timeout(50000) 528 this.timeout(50000)
529 529
530 await servers[1].subscriptions.add({ targetUri: 'user_1_channel@localhost:' + servers[0].port }) 530 await servers[1].subscriptions.add({ targetUri: 'user_1_channel@' + servers[0].host })
531 await waitJobs(servers) 531 await waitJobs(servers)
532 532
533 await checkNewActorFollow({ 533 await checkNewActorFollow({
@@ -539,14 +539,14 @@ describe('Test user notifications', function () {
539 checkType: 'presence' 539 checkType: 'presence'
540 }) 540 })
541 541
542 await servers[1].subscriptions.remove({ uri: 'user_1_channel@localhost:' + servers[0].port }) 542 await servers[1].subscriptions.remove({ uri: 'user_1_channel@' + servers[0].host })
543 }) 543 })
544 544
545 // PeerTube does not support account -> account follows 545 // PeerTube does not support account -> account follows
546 // it('Should notify when a local account is following one of our channel', async function () { 546 // it('Should notify when a local account is following one of our channel', async function () {
547 // this.timeout(50000) 547 // this.timeout(50000)
548 // 548 //
549 // await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1@localhost:' + servers[0].port) 549 // await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1@' + servers[0].host)
550 // 550 //
551 // await waitJobs(servers) 551 // await waitJobs(servers)
552 // 552 //
@@ -556,7 +556,7 @@ describe('Test user notifications', function () {
556 // it('Should notify when a remote account is following one of our channel', async function () { 556 // it('Should notify when a remote account is following one of our channel', async function () {
557 // this.timeout(50000) 557 // this.timeout(50000)
558 // 558 //
559 // await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1@localhost:' + servers[0].port) 559 // await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1@' + servers[0].host)
560 // 560 //
561 // await waitJobs(servers) 561 // await waitJobs(servers)
562 // 562 //