X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fplugins%2Fplugin-router.ts;h=24e6a1e834701c97c4d6b088a66135a8753871d1;hb=9c6327f803aaf4200672f1fc40b2f43786daca47;hp=9e78568cdfe73ff438814b55c349c83d486113c6;hpb=2d53be0267acc49cda46707b885096193a1f4e9c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/plugins/plugin-router.ts b/server/tests/plugins/plugin-router.ts index 9e78568cd..24e6a1e83 100644 --- a/server/tests/plugins/plugin-router.ts +++ b/server/tests/plugins/plugin-router.ts @@ -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',