]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/api/activitypub/client.ts
Fix dependency errors between modules
[github/Chocobozzz/PeerTube.git] / server / tests / api / activitypub / client.ts
1 /* tslint:disable:no-unused-expression */
2
3 import * as chai from 'chai'
4 import 'mocha'
5 import {
6 flushTests,
7 killallServers,
8 makeActivityPubGetRequest,
9 runServer,
10 ServerInfo,
11 setAccessTokensToServers
12 } from '../../../../shared/utils'
13
14
15 const expect = chai.expect
16
17 describe('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 })