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/api/videos/video-playlists.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'server/tests/api/videos/video-playlists.ts') diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts index 7d1215990..0a96ea9a0 100644 --- a/server/tests/api/videos/video-playlists.ts +++ b/server/tests/api/videos/video-playlists.ts @@ -61,6 +61,7 @@ import { removeServerFromAccountBlocklist, removeServerFromServerBlocklist } from '../../../../shared/extra-utils/users/blocklist' +import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' const expect = chai.expect @@ -1091,7 +1092,7 @@ describe('Test video playlists', function () { await waitJobs(servers) for (const server of servers) { - await getVideoPlaylist(server.url, videoPlaylistIds.uuid, 200) + await getVideoPlaylist(server.url, videoPlaylistIds.uuid, HttpStatusCode.OK_200) } const playlistAttrs = { privacy: VideoPlaylistPrivacy.PRIVATE } @@ -1100,11 +1101,11 @@ describe('Test video playlists', function () { await waitJobs(servers) for (const server of [ servers[1], servers[2] ]) { - await getVideoPlaylist(server.url, videoPlaylistIds.uuid, 404) + await getVideoPlaylist(server.url, videoPlaylistIds.uuid, HttpStatusCode.NOT_FOUND_404) } - await getVideoPlaylist(servers[0].url, videoPlaylistIds.uuid, 401) + await getVideoPlaylist(servers[0].url, videoPlaylistIds.uuid, HttpStatusCode.UNAUTHORIZED_401) - await getVideoPlaylistWithToken(servers[0].url, servers[0].accessToken, videoPlaylistIds.uuid, 200) + await getVideoPlaylistWithToken(servers[0].url, servers[0].accessToken, videoPlaylistIds.uuid, HttpStatusCode.OK_200) }) }) @@ -1118,7 +1119,7 @@ describe('Test video playlists', function () { await waitJobs(servers) for (const server of servers) { - await getVideoPlaylist(server.url, playlistServer1UUID, 404) + await getVideoPlaylist(server.url, playlistServer1UUID, HttpStatusCode.NOT_FOUND_404) } }) @@ -1178,7 +1179,7 @@ describe('Test video playlists', function () { expect(res3.body.displayName).to.equal('channel playlist') expect(res3.body.privacy.id).to.equal(VideoPlaylistPrivacy.PRIVATE) - await getVideoPlaylist(servers[1].url, videoPlaylistUUID, 404) + await getVideoPlaylist(servers[1].url, videoPlaylistUUID, HttpStatusCode.NOT_FOUND_404) }) it('Should delete an account and delete its playlists', async function () { -- cgit v1.2.3