/* tslint:disable:no-unused-expression */
-import 'mocha'
import * as chai from 'chai'
-const expect = chai.expect
-
+import 'mocha'
+import { VideoPrivacy } from '../../../shared/models/videos/video-privacy.enum'
import {
- ServerInfo,
+ flushAndRunMultipleServers,
flushTests,
- uploadVideo,
- makeFriends,
getVideosList,
- wait,
+ killallServers,
+ ServerInfo,
setAccessTokensToServers,
- flushAndRunMultipleServers,
- killallServers
+ uploadVideo,
+ wait
} from '../utils'
-import { VideoPrivacy } from '../../../shared/models/videos/video-privacy.enum'
-import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../utils/videos'
-import { createUser } from '../utils/users'
+import { doubleFollow } from '../utils/follows'
import { getUserAccessToken } from '../utils/login'
+import { createUser } from '../utils/users'
+import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../utils/videos'
+
+const expect = chai.expect
describe('Test video privacy', function () {
let servers: ServerInfo[] = []
// Get the access tokens
await setAccessTokensToServers(servers)
- // Pod 1 makes friend with pod 2
- await makeFriends(servers[0].url, servers[0].accessToken)
+ // Server 1 and server 2 follow each other
+ await doubleFollow(servers[0], servers[1])
})
- it('Should upload a private video on pod 1', async function () {
+ it('Should upload a private video on server 1', async function () {
this.timeout(15000)
const attributes = {
await wait(11000)
})
- it('Should not have this private video on pod 2', async function () {
+ it('Should not have this private video on server 2', async function () {
const res = await getVideosList(servers[1].url)
expect(res.body.total).to.equal(0)
await getVideoWithToken(servers[0].url, servers[0].accessToken, privateVideoUUID)
})
- it('Should upload a unlisted video on pod 2', async function () {
+ it('Should upload a unlisted video on server 2', async function () {
this.timeout(30000)
const attributes = {
await wait(22000)
})
- it('Should not have this unlisted video listed on pod 1 and 2', async function () {
+ it('Should not have this unlisted video listed on server 1 and 2', async function () {
for (const server of servers) {
const res = await getVideosList(server.url)
}
})
- it('Should update the private video to public on pod 1', async function () {
+ it('Should update the private video to public on server 1', async function () {
this.timeout(15000)
const attribute = {
await wait(11000)
})
- it('Should not have this new unlisted video listed on pod 1 and 2', async function () {
+ it('Should not have this new unlisted video listed on server 1 and 2', async function () {
for (const server of servers) {
const res = await getVideosList(server.url)