/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
import { expect } from 'chai'
-import { omit } from 'lodash'
-import { buildAbsoluteFixturePath } from '@shared/core-utils'
+import { buildAbsoluteFixturePath, omit } from '@shared/core-utils'
import { HttpStatusCode, LiveVideoLatencyMode, VideoCreateResult, VideoPrivacy } from '@shared/models'
import {
cleanupTests,
const username = 'user1'
const password = 'my super password'
- await server.users.create({ username: username, password: password })
+ await server.users.create({ username, password })
userAccessToken = await server.login.getAccessToken({ username, password })
{
})
it('Should fail without a channel', async function () {
- const fields = omit(baseCorrectParams, 'channelId')
+ const fields = omit(baseCorrectParams, [ 'channelId' ])
await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
})
await stopFfmpeg(ffmpegCommand)
})
+ it('Should fail to change live privacy if it has already started', async function () {
+ this.timeout(40000)
+
+ const live = await command.get({ videoId: video.id })
+
+ const ffmpegCommand = sendRTMPStream({ rtmpBaseUrl: live.rtmpUrl, streamKey: live.streamKey })
+
+ await command.waitUntilPublished({ videoId: video.id })
+ await server.videos.update({
+ id: video.id,
+ attributes: { privacy: VideoPrivacy.PUBLIC },
+ expectedStatus: HttpStatusCode.BAD_REQUEST_400
+ })
+
+ await stopFfmpeg(ffmpegCommand)
+ })
+
it('Should fail to stream twice in the save live', async function () {
this.timeout(40000)