/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
import { FIXTURE_URLS } from '@server/tests/shared'
import { sortObjectComparator } from '@shared/core-utils'
import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@shared/models'
waitJobs
} from '@shared/server-commands'
-const expect = chai.expect
-
describe('Test video blacklist', function () {
let servers: PeerTubeServer[] = []
let videoId: number
let video4UUID: string
before(async function () {
- this.timeout(10000)
-
{
const { uuid } = await servers[0].videos.upload({ attributes: { name: 'Video 3' } })
video3UUID = uuid
})
it('Should blacklist video 3 and keep it federated', async function () {
- this.timeout(10000)
-
await command.add({ videoId: video3UUID, reason: 'super reason', unfederate: false })
await waitJobs(servers)
})
it('Should unfederate the video', async function () {
- this.timeout(10000)
-
await command.add({ videoId: video4UUID, reason: 'super reason', unfederate: true })
await waitJobs(servers)
})
it('Should have the video unfederated even after an Update AP message', async function () {
- this.timeout(10000)
-
await servers[0].videos.update({ id: video4UUID, attributes: { description: 'super description' } })
await waitJobs(servers)
})
it('Should remove the video from blacklist and refederate the video', async function () {
- this.timeout(10000)
-
await command.remove({ videoId: video4UUID })
await waitJobs(servers)