From f2eb23cd87cf32b8fe545178143b5f49e06a58da Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 8 Dec 2020 21:16:10 +0100 Subject: emit more specific status codes on video upload (#3423) - reduce http status codes list to potentially useful codes - convert more codes to typed ones - factorize html generator for error responses --- server/tests/plugins/video-constants.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'server/tests/plugins/video-constants.ts') diff --git a/server/tests/plugins/video-constants.ts b/server/tests/plugins/video-constants.ts index fec9196e2..5ee41fee1 100644 --- a/server/tests/plugins/video-constants.ts +++ b/server/tests/plugins/video-constants.ts @@ -16,6 +16,7 @@ import { uploadVideo } from '../../../shared/extra-utils' import { VideoDetails, VideoPlaylistPrivacy } from '../../../shared/models/videos' +import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' const expect = chai.expect @@ -89,12 +90,17 @@ describe('Test plugin altering video constants', function () { it('Should not be able to create a video with this privacy', async function () { const attrs = { name: 'video', privacy: 2 } - await uploadVideo(server.url, server.accessToken, attrs, 400) + await uploadVideo(server.url, server.accessToken, attrs, HttpStatusCode.BAD_REQUEST_400) }) it('Should not be able to create a video with this privacy', async function () { const attrs = { displayName: 'video playlist', privacy: VideoPlaylistPrivacy.PRIVATE } - await createVideoPlaylist({ url: server.url, token: server.accessToken, playlistAttrs: attrs, expectedStatus: 400 }) + await createVideoPlaylist({ + url: server.url, + token: server.accessToken, + playlistAttrs: attrs, + expectedStatus: HttpStatusCode.BAD_REQUEST_400 + }) }) it('Should be able to upload a video with these values', async function () { -- cgit v1.2.3