aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/activitypub/client.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/activitypub/client.ts')
-rw-r--r--server/tests/api/activitypub/client.ts43
1 files changed, 43 insertions, 0 deletions
diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts
new file mode 100644
index 000000000..334cd4e5c
--- /dev/null
+++ b/server/tests/api/activitypub/client.ts
@@ -0,0 +1,43 @@
1/* tslint:disable:no-unused-expression */
2
3import * as chai from 'chai'
4import 'mocha'
5import {
6 flushTests,
7 killallServers,
8 makeActivityPubGetRequest,
9 runServer,
10 ServerInfo,
11 setAccessTokensToServers
12} from '../../shared/utils'
13
14
15const expect = chai.expect
16
17describe('Test activitypub', function () {
18 let server: ServerInfo = null
19
20 before(async function () {
21 this.timeout(30000)
22
23 await flushTests()
24
25 server = await runServer(1)
26
27 await setAccessTokensToServers([ server ])
28 })
29
30 it('Should return the account object', async function () {
31 const res = await makeActivityPubGetRequest(server.url, '/accounts/root')
32 const object = res.body
33
34 expect(object.type).to.equal('Person')
35 expect(object.id).to.equal('http://localhost:9001/accounts/root')
36 expect(object.name).to.equal('root')
37 expect(object.preferredUsername).to.equal('root')
38 })
39
40 after(async function () {
41 killallServers([ server ])
42 })
43})