/* tslint:disable:no-unused-expression */
+
import * as chai from 'chai'
import 'mocha'
import { UserRole } from '../../../shared'
} from '../utils'
import { follow } from '../utils/follows'
import { getMyVideos } from '../utils/videos'
+import { setAccessTokensToServers } from '../utils/login'
const expect = chai.expect
await flushTests()
server = await runServer(1)
+
+ await setAccessTokensToServers([ server ])
})
it('Should create a new client')
})
it('Should list all the users', async function () {
- const res = await getUsersList(server.url)
+ const res = await getUsersList(server.url, server.accessToken)
const result = res.body
const total = result.total
const users = result.data
})
it('Should list only the first user by username asc', async function () {
- const res = await getUsersListPaginationAndSort(server.url, 0, 1, 'username')
+ const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, 'username')
const result = res.body
const total = result.total
})
it('Should list only the first user by username desc', async function () {
- const res = await getUsersListPaginationAndSort(server.url, 0, 1, '-username')
+ const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, '-username')
const result = res.body
const total = result.total
const users = result.data
})
it('Should list only the second user by createdAt desc', async function () {
- const res = await getUsersListPaginationAndSort(server.url, 0, 1, '-createdAt')
+ const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 1, '-createdAt')
const result = res.body
const total = result.total
const users = result.data
})
it('Should list all the users by createdAt asc', async function () {
- const res = await getUsersListPaginationAndSort(server.url, 0, 2, 'createdAt')
+ const res = await getUsersListPaginationAndSort(server.url, server.accessToken, 0, 2, 'createdAt')
const result = res.body
const total = result.total
const users = result.data