diff options
author | Chocobozzz <me@florianbigard.com> | 2021-01-14 14:13:23 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-01-15 10:49:10 +0100 |
commit | d43c6b1ffc5e6c895f9e9f9de6625f17a9755c20 (patch) | |
tree | 6bdcbe9893574e0b5a41c4854c7f986f346ba761 /server/tests | |
parent | b0a9743af0273835cdf594431a774c0f7d46b539 (diff) | |
download | PeerTube-d43c6b1ffc5e6c895f9e9f9de6625f17a9755c20.tar.gz PeerTube-d43c6b1ffc5e6c895f9e9f9de6625f17a9755c20.tar.zst PeerTube-d43c6b1ffc5e6c895f9e9f9de6625f17a9755c20.zip |
Implement remote interaction
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/misc-endpoints.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/server/tests/misc-endpoints.ts b/server/tests/misc-endpoints.ts index 162b53e18..09e5afcf9 100644 --- a/server/tests/misc-endpoints.ts +++ b/server/tests/misc-endpoints.ts | |||
@@ -80,6 +80,31 @@ describe('Test misc endpoints', function () { | |||
80 | 80 | ||
81 | expect(res.header.location).to.equal('/my-account/settings') | 81 | expect(res.header.location).to.equal('/my-account/settings') |
82 | }) | 82 | }) |
83 | |||
84 | it('Should test webfinger', async function () { | ||
85 | const resource = 'acct:peertube@' + server.host | ||
86 | const accountUrl = server.url + '/accounts/peertube' | ||
87 | |||
88 | const res = await makeGetRequest({ | ||
89 | url: server.url, | ||
90 | path: '/.well-known/webfinger?resource=' + resource, | ||
91 | statusCodeExpected: HttpStatusCode.OK_200 | ||
92 | }) | ||
93 | |||
94 | const data = res.body | ||
95 | |||
96 | expect(data.subject).to.equal(resource) | ||
97 | expect(data.aliases).to.contain(accountUrl) | ||
98 | |||
99 | const self = data.links.find(l => l.rel === 'self') | ||
100 | expect(self).to.exist | ||
101 | expect(self.type).to.equal('application/activity+json') | ||
102 | expect(self.href).to.equal(accountUrl) | ||
103 | |||
104 | const remoteInteract = data.links.find(l => l.rel === 'http://ostatus.org/schema/1.0/subscribe') | ||
105 | expect(remoteInteract).to.exist | ||
106 | expect(remoteInteract.template).to.equal(server.url + '/remote-interaction?uri={uri}') | ||
107 | }) | ||
83 | }) | 108 | }) |
84 | 109 | ||
85 | describe('Test classic static endpoints', function () { | 110 | describe('Test classic static endpoints', function () { |