]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/abuses.ts
Add playback metric endpoint sent to OTEL
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / abuses.ts
index fb9a5fd8b061b05a7db52dc35cfa9b58edebbd75..7d8347412b077bef8cbb4c184742a630a7f270a3 100644 (file)
@@ -1,11 +1,10 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
 import 'mocha'
+import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared'
+import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models'
 import {
   AbusesCommand,
-  checkBadCountPagination,
-  checkBadSortPagination,
-  checkBadStartPagination,
   cleanupTests,
   createSingleServer,
   doubleFollow,
@@ -14,8 +13,7 @@ import {
   PeerTubeServer,
   setAccessTokensToServers,
   waitJobs
-} from '@shared/extra-utils'
-import { AbuseCreate, AbuseState, HttpStatusCode } from '@shared/models'
+} from '@shared/server-commands'
 
 describe('Test abuses API validators', function () {
   const basePath = '/api/v1/abuses/'
@@ -165,7 +163,7 @@ describe('Test abuses API validators', function () {
 
     it('Should fail with a wrong video', async function () {
       const fields = { video: { id: 'blabla' }, reason: 'my super reason' }
-      await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields })
+      await makePostBodyRequest({ url: server.url, path, token: userToken, fields })
     })
 
     it('Should fail with an unknown video', async function () {
@@ -181,7 +179,7 @@ describe('Test abuses API validators', function () {
 
     it('Should fail with a wrong comment', async function () {
       const fields = { comment: { id: 'blabla' }, reason: 'my super reason' }
-      await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields })
+      await makePostBodyRequest({ url: server.url, path, token: userToken, fields })
     })
 
     it('Should fail with an unknown comment', async function () {
@@ -197,7 +195,7 @@ describe('Test abuses API validators', function () {
 
     it('Should fail with a wrong account', async function () {
       const fields = { account: { id: 'blabla' }, reason: 'my super reason' }
-      await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields })
+      await makePostBodyRequest({ url: server.url, path, token: userToken, fields })
     })
 
     it('Should fail with an unknown account', async function () {
@@ -271,7 +269,7 @@ describe('Test abuses API validators', function () {
       await makePostBodyRequest({ url: server.url, path, token: userToken, fields })
     })
 
-    it('Should succeed with the corret parameters (advanced)', async function () {
+    it('Should succeed with the correct parameters (advanced)', async function () {
       const fields: AbuseCreate = {
         video: {
           id: server.store.videoCreated.id,
@@ -335,7 +333,7 @@ describe('Test abuses API validators', function () {
       await command.addMessage({ token: userToken, abuseId, message: 'a'.repeat(5000), expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
     })
 
-    it('Should suceed with the correct params', async function () {
+    it('Should succeed with the correct params', async function () {
       const res = await command.addMessage({ token: userToken, abuseId, message })
       messageId = res.body.abuseMessage.id
     })