import { createFile, readdir } from 'fs-extra'
import { join } from 'path'
import { buildUUID } from '@server/helpers/uuid'
-import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
+import { HttpStatusCode } from '@shared/core-utils'
import {
buildServerDirectory,
cleanupTests,
CLICommand,
- createVideoPlaylist,
doubleFollow,
flushAndRunMultipleServers,
- getAccount,
killallServers,
makeGetRequest,
ServerInfo,
setDefaultVideoChannel,
updateMyAvatar,
uploadVideo,
- wait
-} from '../../../shared/extra-utils'
-import { waitJobs } from '../../../shared/extra-utils/server/jobs'
-import { Account, VideoPlaylistPrivacy } from '../../../shared/models'
+ wait,
+ waitJobs
+} from '@shared/extra-utils'
+import { VideoPlaylistPrivacy } from '@shared/models'
const expect = chai.expect
await updateMyAvatar({ url: server.url, accessToken: server.accessToken, fixture: 'avatar.png' })
- await createVideoPlaylist({
- url: server.url,
- token: server.accessToken,
- playlistAttrs: {
+ await server.playlistsCommand.create({
+ attributes: {
displayName: 'playlist',
privacy: VideoPlaylistPrivacy.PUBLIC,
videoChannelId: server.videoChannel.id,
// Lazy load the remote avatar
{
- const res = await getAccount(servers[0].url, 'root@localhost:' + servers[1].port)
- const account: Account = res.body
+ const account = await servers[0].accountsCommand.get({ accountName: 'root@localhost:' + servers[1].port })
await makeGetRequest({
url: servers[0].url,
path: account.avatar.path,
}
{
- const res = await getAccount(servers[1].url, 'root@localhost:' + servers[0].port)
- const account: Account = res.body
+ const account = await servers[1].accountsCommand.get({ accountName: 'root@localhost:' + servers[0].port })
await makeGetRequest({
url: servers[1].url,
path: account.avatar.path,
await wait(1000)
await waitJobs(servers)
- killallServers(servers)
+ await killallServers(servers)
await wait(1000)
})