X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fmisc-endpoints.ts;h=09e5afcf9b4bc6c9fc58eb3032638f3798d520da;hb=e62f03ae0412f4efa62917d8741bc1a39e8ed7fc;hp=698d833283caea5b5a03e0463ccc1f2231b91453;hpb=2d53be0267acc49cda46707b885096193a1f4e9c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/misc-endpoints.ts b/server/tests/misc-endpoints.ts index 698d83328..09e5afcf9 100644 --- a/server/tests/misc-endpoints.ts +++ b/server/tests/misc-endpoints.ts @@ -80,6 +80,31 @@ describe('Test misc endpoints', function () { expect(res.header.location).to.equal('/my-account/settings') }) + + it('Should test webfinger', async function () { + const resource = 'acct:peertube@' + server.host + const accountUrl = server.url + '/accounts/peertube' + + const res = await makeGetRequest({ + url: server.url, + path: '/.well-known/webfinger?resource=' + resource, + statusCodeExpected: HttpStatusCode.OK_200 + }) + + const data = res.body + + expect(data.subject).to.equal(resource) + expect(data.aliases).to.contain(accountUrl) + + const self = data.links.find(l => l.rel === 'self') + expect(self).to.exist + expect(self.type).to.equal('application/activity+json') + expect(self.href).to.equal(accountUrl) + + const remoteInteract = data.links.find(l => l.rel === 'http://ostatus.org/schema/1.0/subscribe') + expect(remoteInteract).to.exist + expect(remoteInteract.template).to.equal(server.url + '/remote-interaction?uri={uri}') + }) }) describe('Test classic static endpoints', function () { @@ -110,6 +135,8 @@ describe('Test misc endpoints', function () { }) expect(res.body.software.name).to.equal('peertube') + expect(res.body.usage.users.activeMonth).to.equal(1) + expect(res.body.usage.users.activeHalfyear).to.equal(1) }) })