+ await command.update({ videoId: videoIdNotLive, fields: {}, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+ })
+
+ it('Should fail with bad latency setting', async function () {
+ const fields = { latencyMode: 42 }
+
+ await command.update({ videoId: video.id, fields, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
+ })
+
+ it('Should fail with a bad privacy for replay settings', async function () {
+ const fields = { saveReplay: true, replaySettings: { privacy: 5 } }
+
+ await command.update({ videoId: video.id, fields, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
+ })
+
+ it('Should fail with save replay enabled but without replay settings', async function () {
+ await server.config.updateCustomSubConfig({
+ newConfig: {
+ live: {
+ enabled: true,
+ allowReplay: true
+ }
+ }
+ })
+
+ const fields = { saveReplay: true }
+
+ await command.update({ videoId: video.id, fields, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
+ })
+
+ it('Should fail with save replay disabled and replay settings', async function () {
+ const fields = { saveReplay: false, replaySettings: { privacy: VideoPrivacy.INTERNAL } }
+
+ await command.update({ videoId: video.id, fields, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })