]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/redundancy.ts
Fix CI using 127.0.0.1 for tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / redundancy.ts
index 04519cf23c97cfe8cfe6ba447ca252a5d47ae23c..908407b9a5a898a1e5ce823072373f467037eb29 100644 (file)
@@ -1,6 +1,5 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
 import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
 import { HttpStatusCode, VideoCreateResult } from '@shared/models'
 import {
@@ -187,7 +186,7 @@ describe('Test server redundancy API validators', function () {
     it('Should fail with an invalid token', async function () {
       await makePutBodyRequest({
         url: servers[0].url,
-        path: path + '/localhost:' + servers[1].port,
+        path: path + '/' + servers[1].host,
         fields: { redundancyAllowed: true },
         token: 'fake_token',
         expectedStatus: HttpStatusCode.UNAUTHORIZED_401
@@ -197,7 +196,7 @@ describe('Test server redundancy API validators', function () {
     it('Should fail if the user is not an administrator', async function () {
       await makePutBodyRequest({
         url: servers[0].url,
-        path: path + '/localhost:' + servers[1].port,
+        path: path + '/' + servers[1].host,
         fields: { redundancyAllowed: true },
         token: userAccessToken,
         expectedStatus: HttpStatusCode.FORBIDDEN_403
@@ -217,7 +216,7 @@ describe('Test server redundancy API validators', function () {
     it('Should fail without de redundancyAllowed param', async function () {
       await makePutBodyRequest({
         url: servers[0].url,
-        path: path + '/localhost:' + servers[1].port,
+        path: path + '/' + servers[1].host,
         fields: { blabla: true },
         token: servers[0].accessToken,
         expectedStatus: HttpStatusCode.BAD_REQUEST_400
@@ -227,7 +226,7 @@ describe('Test server redundancy API validators', function () {
     it('Should succeed with the correct parameters', async function () {
       await makePutBodyRequest({
         url: servers[0].url,
-        path: path + '/localhost:' + servers[1].port,
+        path: path + '/' + servers[1].host,
         fields: { redundancyAllowed: true },
         token: servers[0].accessToken,
         expectedStatus: HttpStatusCode.NO_CONTENT_204