2017-11-30 05:00:40 -06:00
|
|
|
/* tslint:disable:no-unused-expression */
|
|
|
|
|
|
|
|
import * as chai from 'chai'
|
|
|
|
import 'mocha'
|
2017-12-28 06:59:22 -06:00
|
|
|
import { flushTests, killallServers, makeActivityPubGetRequest, runServer, ServerInfo, setAccessTokensToServers } from './utils'
|
2017-11-30 05:00:40 -06:00
|
|
|
|
|
|
|
const expect = chai.expect
|
|
|
|
|
|
|
|
describe('Test activitypub', function () {
|
|
|
|
let server: ServerInfo = null
|
|
|
|
|
|
|
|
before(async function () {
|
2018-01-18 11:10:45 -06:00
|
|
|
this.timeout(30000)
|
2017-11-30 05:00:40 -06:00
|
|
|
|
|
|
|
await flushTests()
|
|
|
|
|
|
|
|
server = await runServer(1)
|
|
|
|
|
|
|
|
await setAccessTokensToServers([ server ])
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Should return the account object', async function () {
|
2018-01-03 03:12:36 -06:00
|
|
|
const res = await makeActivityPubGetRequest(server.url, '/accounts/root')
|
2017-11-30 05:00:40 -06:00
|
|
|
const object = res.body
|
|
|
|
|
|
|
|
expect(object.type).to.equal('Person')
|
2018-01-03 03:12:36 -06:00
|
|
|
expect(object.id).to.equal('http://localhost:9001/accounts/root')
|
2017-11-30 05:00:40 -06:00
|
|
|
expect(object.name).to.equal('root')
|
|
|
|
expect(object.preferredUsername).to.equal('root')
|
|
|
|
})
|
|
|
|
|
|
|
|
after(async function () {
|
|
|
|
killallServers([ server ])
|
|
|
|
})
|
|
|
|
})
|