diff options
Diffstat (limited to 'server/tests/api/moderation')
-rw-r--r-- | server/tests/api/moderation/blocklist.ts | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/server/tests/api/moderation/blocklist.ts b/server/tests/api/moderation/blocklist.ts index 27592e8c5..47d29e7f8 100644 --- a/server/tests/api/moderation/blocklist.ts +++ b/server/tests/api/moderation/blocklist.ts | |||
@@ -154,7 +154,7 @@ describe('Test blocklist', function () { | |||
154 | }) | 154 | }) |
155 | 155 | ||
156 | it('Should block a remote account', async function () { | 156 | it('Should block a remote account', async function () { |
157 | await command.addToMyBlocklist({ account: 'user2@localhost:' + servers[1].port }) | 157 | await command.addToMyBlocklist({ account: 'user2@' + servers[1].host }) |
158 | }) | 158 | }) |
159 | 159 | ||
160 | it('Should hide its videos', async function () { | 160 | it('Should hide its videos', async function () { |
@@ -217,7 +217,7 @@ describe('Test blocklist', function () { | |||
217 | server: servers[0], | 217 | server: servers[0], |
218 | token: userToken1, | 218 | token: userToken1, |
219 | videoUUID: videoUUID2, | 219 | videoUUID: videoUUID2, |
220 | text: 'hello @root@localhost:' + servers[0].port | 220 | text: 'hello @root@' + servers[0].host |
221 | } | 221 | } |
222 | await checkCommentNotification(servers[0], comment, 'absence') | 222 | await checkCommentNotification(servers[0], comment, 'absence') |
223 | } | 223 | } |
@@ -237,7 +237,7 @@ describe('Test blocklist', function () { | |||
237 | expect(block.byAccount.name).to.equal('root') | 237 | expect(block.byAccount.name).to.equal('root') |
238 | expect(block.blockedAccount.displayName).to.equal('user2') | 238 | expect(block.blockedAccount.displayName).to.equal('user2') |
239 | expect(block.blockedAccount.name).to.equal('user2') | 239 | expect(block.blockedAccount.name).to.equal('user2') |
240 | expect(block.blockedAccount.host).to.equal('localhost:' + servers[1].port) | 240 | expect(block.blockedAccount.host).to.equal('' + servers[1].host) |
241 | } | 241 | } |
242 | 242 | ||
243 | { | 243 | { |
@@ -249,7 +249,7 @@ describe('Test blocklist', function () { | |||
249 | expect(block.byAccount.name).to.equal('root') | 249 | expect(block.byAccount.name).to.equal('root') |
250 | expect(block.blockedAccount.displayName).to.equal('user1') | 250 | expect(block.blockedAccount.displayName).to.equal('user1') |
251 | expect(block.blockedAccount.name).to.equal('user1') | 251 | expect(block.blockedAccount.name).to.equal('user1') |
252 | expect(block.blockedAccount.host).to.equal('localhost:' + servers[0].port) | 252 | expect(block.blockedAccount.host).to.equal('' + servers[0].host) |
253 | } | 253 | } |
254 | }) | 254 | }) |
255 | 255 | ||
@@ -347,7 +347,7 @@ describe('Test blocklist', function () { | |||
347 | }) | 347 | }) |
348 | 348 | ||
349 | it('Should unblock the remote account', async function () { | 349 | it('Should unblock the remote account', async function () { |
350 | await command.removeFromMyBlocklist({ account: 'user2@localhost:' + servers[1].port }) | 350 | await command.removeFromMyBlocklist({ account: 'user2@' + servers[1].host }) |
351 | }) | 351 | }) |
352 | 352 | ||
353 | it('Should display its videos', async function () { | 353 | it('Should display its videos', async function () { |
@@ -401,7 +401,7 @@ describe('Test blocklist', function () { | |||
401 | server: servers[0], | 401 | server: servers[0], |
402 | token: userToken1, | 402 | token: userToken1, |
403 | videoUUID: videoUUID2, | 403 | videoUUID: videoUUID2, |
404 | text: 'hello @root@localhost:' + servers[0].port | 404 | text: 'hello @root@' + servers[0].host |
405 | } | 405 | } |
406 | await checkCommentNotification(servers[0], comment, 'presence') | 406 | await checkCommentNotification(servers[0], comment, 'presence') |
407 | } | 407 | } |
@@ -419,7 +419,7 @@ describe('Test blocklist', function () { | |||
419 | }) | 419 | }) |
420 | 420 | ||
421 | it('Should block a remote server', async function () { | 421 | it('Should block a remote server', async function () { |
422 | await command.addToMyBlocklist({ server: 'localhost:' + servers[1].port }) | 422 | await command.addToMyBlocklist({ server: '' + servers[1].host }) |
423 | }) | 423 | }) |
424 | 424 | ||
425 | it('Should hide its videos', async function () { | 425 | it('Should hide its videos', async function () { |
@@ -463,7 +463,7 @@ describe('Test blocklist', function () { | |||
463 | server: servers[1], | 463 | server: servers[1], |
464 | token: userToken2, | 464 | token: userToken2, |
465 | videoUUID: videoUUID1, | 465 | videoUUID: videoUUID1, |
466 | text: 'hello @root@localhost:' + servers[0].port | 466 | text: 'hello @root@' + servers[0].host |
467 | } | 467 | } |
468 | await checkCommentNotification(servers[0], comment, 'absence') | 468 | await checkCommentNotification(servers[0], comment, 'absence') |
469 | } | 469 | } |
@@ -476,7 +476,7 @@ describe('Test blocklist', function () { | |||
476 | const block = body.data[0] | 476 | const block = body.data[0] |
477 | expect(block.byAccount.displayName).to.equal('root') | 477 | expect(block.byAccount.displayName).to.equal('root') |
478 | expect(block.byAccount.name).to.equal('root') | 478 | expect(block.byAccount.name).to.equal('root') |
479 | expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) | 479 | expect(block.blockedServer.host).to.equal('' + servers[1].host) |
480 | }) | 480 | }) |
481 | 481 | ||
482 | it('Should search blocked servers', async function () { | 482 | it('Should search blocked servers', async function () { |
@@ -516,7 +516,7 @@ describe('Test blocklist', function () { | |||
516 | }) | 516 | }) |
517 | 517 | ||
518 | it('Should unblock the remote server', async function () { | 518 | it('Should unblock the remote server', async function () { |
519 | await command.removeFromMyBlocklist({ server: 'localhost:' + servers[1].port }) | 519 | await command.removeFromMyBlocklist({ server: '' + servers[1].host }) |
520 | }) | 520 | }) |
521 | 521 | ||
522 | it('Should display its videos', function () { | 522 | it('Should display its videos', function () { |
@@ -540,7 +540,7 @@ describe('Test blocklist', function () { | |||
540 | server: servers[1], | 540 | server: servers[1], |
541 | token: userToken2, | 541 | token: userToken2, |
542 | videoUUID: videoUUID1, | 542 | videoUUID: videoUUID1, |
543 | text: 'hello @root@localhost:' + servers[0].port | 543 | text: 'hello @root@' + servers[0].host |
544 | } | 544 | } |
545 | await checkCommentNotification(servers[0], comment, 'presence') | 545 | await checkCommentNotification(servers[0], comment, 'presence') |
546 | } | 546 | } |
@@ -564,7 +564,7 @@ describe('Test blocklist', function () { | |||
564 | }) | 564 | }) |
565 | 565 | ||
566 | it('Should block a remote account', async function () { | 566 | it('Should block a remote account', async function () { |
567 | await command.addToServerBlocklist({ account: 'user2@localhost:' + servers[1].port }) | 567 | await command.addToServerBlocklist({ account: 'user2@' + servers[1].host }) |
568 | }) | 568 | }) |
569 | 569 | ||
570 | it('Should hide its videos', async function () { | 570 | it('Should hide its videos', async function () { |
@@ -624,7 +624,7 @@ describe('Test blocklist', function () { | |||
624 | server: servers[1], | 624 | server: servers[1], |
625 | token: userToken2, | 625 | token: userToken2, |
626 | videoUUID: videoUUID1, | 626 | videoUUID: videoUUID1, |
627 | text: 'hello @root@localhost:' + servers[0].port | 627 | text: 'hello @root@' + servers[0].host |
628 | } | 628 | } |
629 | await checkCommentNotification(servers[0], comment, 'absence') | 629 | await checkCommentNotification(servers[0], comment, 'absence') |
630 | } | 630 | } |
@@ -640,7 +640,7 @@ describe('Test blocklist', function () { | |||
640 | expect(block.byAccount.name).to.equal('peertube') | 640 | expect(block.byAccount.name).to.equal('peertube') |
641 | expect(block.blockedAccount.displayName).to.equal('user2') | 641 | expect(block.blockedAccount.displayName).to.equal('user2') |
642 | expect(block.blockedAccount.name).to.equal('user2') | 642 | expect(block.blockedAccount.name).to.equal('user2') |
643 | expect(block.blockedAccount.host).to.equal('localhost:' + servers[1].port) | 643 | expect(block.blockedAccount.host).to.equal('' + servers[1].host) |
644 | } | 644 | } |
645 | 645 | ||
646 | { | 646 | { |
@@ -652,7 +652,7 @@ describe('Test blocklist', function () { | |||
652 | expect(block.byAccount.name).to.equal('peertube') | 652 | expect(block.byAccount.name).to.equal('peertube') |
653 | expect(block.blockedAccount.displayName).to.equal('user1') | 653 | expect(block.blockedAccount.displayName).to.equal('user1') |
654 | expect(block.blockedAccount.name).to.equal('user1') | 654 | expect(block.blockedAccount.name).to.equal('user1') |
655 | expect(block.blockedAccount.host).to.equal('localhost:' + servers[0].port) | 655 | expect(block.blockedAccount.host).to.equal('' + servers[0].host) |
656 | } | 656 | } |
657 | }) | 657 | }) |
658 | 658 | ||
@@ -685,7 +685,7 @@ describe('Test blocklist', function () { | |||
685 | }) | 685 | }) |
686 | 686 | ||
687 | it('Should unblock the remote account', async function () { | 687 | it('Should unblock the remote account', async function () { |
688 | await command.removeFromServerBlocklist({ account: 'user2@localhost:' + servers[1].port }) | 688 | await command.removeFromServerBlocklist({ account: 'user2@' + servers[1].host }) |
689 | }) | 689 | }) |
690 | 690 | ||
691 | it('Should display its videos', async function () { | 691 | it('Should display its videos', async function () { |
@@ -721,7 +721,7 @@ describe('Test blocklist', function () { | |||
721 | server: servers[1], | 721 | server: servers[1], |
722 | token: userToken2, | 722 | token: userToken2, |
723 | videoUUID: videoUUID1, | 723 | videoUUID: videoUUID1, |
724 | text: 'hello @root@localhost:' + servers[0].port | 724 | text: 'hello @root@' + servers[0].host |
725 | } | 725 | } |
726 | await checkCommentNotification(servers[0], comment, 'presence') | 726 | await checkCommentNotification(servers[0], comment, 'presence') |
727 | } | 727 | } |
@@ -743,7 +743,7 @@ describe('Test blocklist', function () { | |||
743 | }) | 743 | }) |
744 | 744 | ||
745 | it('Should block a remote server', async function () { | 745 | it('Should block a remote server', async function () { |
746 | await command.addToServerBlocklist({ server: 'localhost:' + servers[1].port }) | 746 | await command.addToServerBlocklist({ server: '' + servers[1].host }) |
747 | }) | 747 | }) |
748 | 748 | ||
749 | it('Should hide its videos', async function () { | 749 | it('Should hide its videos', async function () { |
@@ -791,7 +791,7 @@ describe('Test blocklist', function () { | |||
791 | server: servers[1], | 791 | server: servers[1], |
792 | token: userToken2, | 792 | token: userToken2, |
793 | videoUUID: videoUUID1, | 793 | videoUUID: videoUUID1, |
794 | text: 'hello @root@localhost:' + servers[0].port | 794 | text: 'hello @root@' + servers[0].host |
795 | } | 795 | } |
796 | await checkCommentNotification(servers[0], comment, 'absence') | 796 | await checkCommentNotification(servers[0], comment, 'absence') |
797 | } | 797 | } |
@@ -820,7 +820,7 @@ describe('Test blocklist', function () { | |||
820 | const block = body.data[0] | 820 | const block = body.data[0] |
821 | expect(block.byAccount.displayName).to.equal('peertube') | 821 | expect(block.byAccount.displayName).to.equal('peertube') |
822 | expect(block.byAccount.name).to.equal('peertube') | 822 | expect(block.byAccount.name).to.equal('peertube') |
823 | expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) | 823 | expect(block.blockedServer.host).to.equal('' + servers[1].host) |
824 | }) | 824 | }) |
825 | 825 | ||
826 | it('Should search blocked servers', async function () { | 826 | it('Should search blocked servers', async function () { |
@@ -848,7 +848,7 @@ describe('Test blocklist', function () { | |||
848 | }) | 848 | }) |
849 | 849 | ||
850 | it('Should unblock the remote server', async function () { | 850 | it('Should unblock the remote server', async function () { |
851 | await command.removeFromServerBlocklist({ server: 'localhost:' + servers[1].port }) | 851 | await command.removeFromServerBlocklist({ server: '' + servers[1].host }) |
852 | }) | 852 | }) |
853 | 853 | ||
854 | it('Should list all videos', async function () { | 854 | it('Should list all videos', async function () { |
@@ -876,7 +876,7 @@ describe('Test blocklist', function () { | |||
876 | server: servers[1], | 876 | server: servers[1], |
877 | token: userToken2, | 877 | token: userToken2, |
878 | videoUUID: videoUUID1, | 878 | videoUUID: videoUUID1, |
879 | text: 'hello @root@localhost:' + servers[0].port | 879 | text: 'hello @root@' + servers[0].host |
880 | } | 880 | } |
881 | await checkCommentNotification(servers[0], comment, 'presence') | 881 | await checkCommentNotification(servers[0], comment, 'presence') |
882 | } | 882 | } |