/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
import { wait } from '@shared/core-utils'
import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
import { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/server-commands'
-const expect = chai.expect
-
describe('Test video privacy', function () {
const servers: PeerTubeServer[] = []
let anotherUserToken: string
describe('Private and internal videos', function () {
it('Should upload a private and internal videos on server 1', async function () {
- this.timeout(10000)
+ this.timeout(50000)
for (const privacy of [ VideoPrivacy.PRIVATE, VideoPrivacy.INTERNAL ]) {
const attributes = { privacy }
})
it('Should not be able to watch the private video with another user', async function () {
- this.timeout(10000)
-
const user = {
username: 'hello',
password: 'super password'
describe('Unlisted videos', function () {
it('Should upload an unlisted video on server 2', async function () {
- this.timeout(60000)
+ this.timeout(120000)
const attributes = {
name: 'unlisted video',
})
it('Should not be able to get this unlisted video using its id', async function () {
- await servers[1].videos.get({ id: unlistedVideo.id, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+ await servers[1].videos.get({ id: unlistedVideo.id, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
})
it('Should be able to get this unlisted video using its uuid/shortUUID', async function () {
})
it('Should set these videos as private and internal', async function () {
- this.timeout(10000)
-
await servers[0].videos.update({ id: internalVideoId, attributes: { privacy: VideoPrivacy.PRIVATE } })
await servers[0].videos.update({ id: privateVideoId, attributes: { privacy: VideoPrivacy.INTERNAL } })