]>
Commit | Line | Data |
---|---|---|
6cbdbdef C |
1 | /* tslint:disable:no-unused-expression */ |
2 | ||
3 | import * as chai from 'chai' | |
4 | import 'mocha' | |
9639bd17 | 5 | import { |
6 | flushTests, | |
7 | killallServers, | |
8 | makeActivityPubGetRequest, | |
9 | runServer, | |
10 | ServerInfo, | |
11 | setAccessTokensToServers | |
12 | } from '../../shared/utils' | |
6cbdbdef | 13 | |
6cbdbdef C |
14 | |
15 | const expect = chai.expect | |
16 | ||
17 | describe('Test activitypub', function () { | |
18 | let server: ServerInfo = null | |
19 | ||
20 | before(async function () { | |
e212f887 | 21 | this.timeout(30000) |
6cbdbdef C |
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 () { | |
47564bbe | 31 | const res = await makeActivityPubGetRequest(server.url, '/accounts/root') |
6cbdbdef C |
32 | const object = res.body |
33 | ||
34 | expect(object.type).to.equal('Person') | |
47564bbe | 35 | expect(object.id).to.equal('http://localhost:9001/accounts/root') |
6cbdbdef C |
36 | expect(object.name).to.equal('root') |
37 | expect(object.preferredUsername).to.equal('root') | |
38 | }) | |
39 | ||
40 | after(async function () { | |
41 | killallServers([ server ]) | |
6cbdbdef C |
42 | }) |
43 | }) |