]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/plugins/plugin-router.ts
Introduce jobs command
[github/Chocobozzz/PeerTube.git] / server / tests / plugins / plugin-router.ts
index 9e78568cdfe73ff438814b55c349c83d486113c6..24e6a1e834701c97c4d6b088a66135a8753871d1 100644 (file)
@@ -44,6 +44,27 @@ describe('Test plugin helpers', function () {
     }
   })
 
+  it('Should check if authenticated', async function () {
+    for (const path of basePaths) {
+      const res = await makeGetRequest({
+        url: server.url,
+        path: path + 'is-authenticated',
+        token: server.accessToken,
+        statusCodeExpected: 200
+      })
+
+      expect(res.body.isAuthenticated).to.equal(true)
+
+      const secRes = await makeGetRequest({
+        url: server.url,
+        path: path + 'is-authenticated',
+        statusCodeExpected: 200
+      })
+
+      expect(secRes.body.isAuthenticated).to.equal(false)
+    }
+  })
+
   it('Should mirror post body', async function () {
     const body = {
       hello: 'world',