]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/video-imports.ts
Add playback metric endpoint sent to OTEL
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / video-imports.ts
index 156a612ee7ab1cd9d861c3990c3f2a4c7d9e1a6b..85382b261e5a04061936e65435a05b0d15cc46da 100644 (file)
@@ -35,7 +35,7 @@ describe('Test video imports API validator', function () {
 
     const username = 'user1'
     const password = 'my super password'
-    await server.users.create({ username: username, password: password })
+    await server.users.create({ username, password })
     userAccessToken = await server.login.getAccessToken({ username, password })
 
     {
@@ -59,6 +59,15 @@ describe('Test video imports API validator', function () {
       await checkBadSortPagination(server.url, myPath, server.accessToken)
     })
 
+    it('Should fail with a bad videoChannelSyncId param', async function () {
+      await makeGetRequest({
+        url: server.url,
+        path: myPath,
+        query: { videoChannelSyncId: 'toto' },
+        token: server.accessToken
+      })
+    })
+
     it('Should success with the correct parameters', async function () {
       await makeGetRequest({ url: server.url, path: myPath, expectedStatus: HttpStatusCode.OK_200, token: server.accessToken })
     })
@@ -88,7 +97,13 @@ describe('Test video imports API validator', function () {
 
     it('Should fail with nothing', async function () {
       const fields = {}
-      await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
+      await makePostBodyRequest({
+        url: server.url,
+        path,
+        token: server.accessToken,
+        fields,
+        expectedStatus: HttpStatusCode.BAD_REQUEST_400
+      })
     })
 
     it('Should fail without a target url', async function () {
@@ -120,7 +135,8 @@ describe('Test video imports API validator', function () {
         'http://127.0.0.1',
         'http://127.0.0.1/hello',
         'https://192.168.1.42',
-        'http://192.168.1.42'
+        'http://192.168.1.42',
+        'http://127.0.0.1.cpy.re'
       ]
 
       for (const targetUrl of targetUrls) {
@@ -271,7 +287,7 @@ describe('Test video imports API validator', function () {
     })
 
     it('Should succeed with the correct parameters', async function () {
-      this.timeout(30000)
+      this.timeout(120000)
 
       await makePostBodyRequest({
         url: server.url,