]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/follows.ts
Only display accepted followers/followings in about page
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / follows.ts
index 2eb54cb0a7ee1f90f29155d3ee923f835ffd3873..488666a754c814c25cd838118db70e8bb995665c 100644 (file)
@@ -6,7 +6,7 @@ import {
   cleanupTests,
   createUser,
   flushAndRunServer,
-  makeDeleteRequest,
+  makeDeleteRequest, makeGetRequest,
   makePostBodyRequest,
   ServerInfo,
   setAccessTokensToServers,
@@ -131,6 +131,27 @@ describe('Test server follows API validators', function () {
       it('Should fail with an incorrect sort', async function () {
         await checkBadSortPagination(server.url, path)
       })
+
+      it('Should fail with an incorrect state', async function () {
+        await makeGetRequest({
+          url: server.url,
+          path,
+          query: {
+            state: 'blabla'
+          }
+        })
+      })
+
+      it('Should fail succeed with the correct params', async function () {
+        await makeGetRequest({
+          url: server.url,
+          path,
+          statusCodeExpected: 200,
+          query: {
+            state: 'accepted'
+          }
+        })
+      })
     })
 
     describe('When listing followers', function () {
@@ -147,6 +168,27 @@ describe('Test server follows API validators', function () {
       it('Should fail with an incorrect sort', async function () {
         await checkBadSortPagination(server.url, path)
       })
+
+      it('Should fail with an incorrect state', async function () {
+        await makeGetRequest({
+          url: server.url,
+          path,
+          query: {
+            state: 'blabla'
+          }
+        })
+      })
+
+      it('Should fail succeed with the correct params', async function () {
+        await makeGetRequest({
+          url: server.url,
+          path,
+          statusCodeExpected: 200,
+          query: {
+            state: 'accepted'
+          }
+        })
+      })
     })
 
     describe('When removing a follower', function () {