X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Flive%2Flive-save-replay.ts;h=e300ec34567ec7981dd1aba8c05e0abad4b99b0f;hb=b49f22d8f9a52ab75fd38db2d377249eb58fa678;hp=3ffa0c093ccb721cab69aa589c380d505acc8129;hpb=68e70a745b2010cd0199864a2addd60d8f99c732;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/live/live-save-replay.ts b/server/tests/api/live/live-save-replay.ts index 3ffa0c093..e300ec345 100644 --- a/server/tests/api/live/live-save-replay.ts +++ b/server/tests/api/live/live-save-replay.ts @@ -25,6 +25,7 @@ import { waitJobs, waitUntilLiveStarts } from '../../../../shared/extra-utils' +import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' const expect = chai.expect @@ -118,7 +119,7 @@ describe('Save replay setting', function () { await waitJobs(servers) - await checkVideosExist(liveVideoUUID, false, 200) + await checkVideosExist(liveVideoUUID, false, HttpStatusCode.OK_200) await checkVideoState(liveVideoUUID, VideoState.WAITING_FOR_LIVE) }) @@ -130,7 +131,7 @@ describe('Save replay setting', function () { await waitJobs(servers) - await checkVideosExist(liveVideoUUID, true, 200) + await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) await checkVideoState(liveVideoUUID, VideoState.PUBLISHED) }) @@ -142,7 +143,7 @@ describe('Save replay setting', function () { await waitJobs(servers) // Live still exist, but cannot be played anymore - await checkVideosExist(liveVideoUUID, false, 200) + await checkVideosExist(liveVideoUUID, false, HttpStatusCode.OK_200) await checkVideoState(liveVideoUUID, VideoState.LIVE_ENDED) // No resolutions saved since we did not save replay @@ -158,7 +159,7 @@ describe('Save replay setting', function () { await waitUntilLiveStarts(servers[0].url, servers[0].accessToken, liveVideoUUID) await waitJobs(servers) - await checkVideosExist(liveVideoUUID, true, 200) + await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) await Promise.all([ addVideoToBlacklist(servers[0].url, servers[0].accessToken, liveVideoUUID, 'bad live', true), @@ -169,8 +170,8 @@ describe('Save replay setting', function () { await checkVideosExist(liveVideoUUID, false) - await getVideo(servers[0].url, liveVideoUUID, 401) - await getVideo(servers[1].url, liveVideoUUID, 404) + await getVideo(servers[0].url, liveVideoUUID, HttpStatusCode.UNAUTHORIZED_401) + await getVideo(servers[1].url, liveVideoUUID, HttpStatusCode.NOT_FOUND_404) await checkLiveCleanup(servers[0], liveVideoUUID, []) }) @@ -184,7 +185,7 @@ describe('Save replay setting', function () { await waitUntilLiveStarts(servers[0].url, servers[0].accessToken, liveVideoUUID) await waitJobs(servers) - await checkVideosExist(liveVideoUUID, true, 200) + await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) await Promise.all([ testFfmpegStreamError(ffmpegCommand, true), @@ -193,7 +194,7 @@ describe('Save replay setting', function () { await waitJobs(servers) - await checkVideosExist(liveVideoUUID, false, 404) + await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404) await checkLiveCleanup(servers[0], liveVideoUUID, []) }) }) @@ -207,7 +208,7 @@ describe('Save replay setting', function () { await waitJobs(servers) - await checkVideosExist(liveVideoUUID, false, 200) + await checkVideosExist(liveVideoUUID, false, HttpStatusCode.OK_200) await checkVideoState(liveVideoUUID, VideoState.WAITING_FOR_LIVE) }) @@ -219,7 +220,7 @@ describe('Save replay setting', function () { await waitJobs(servers) - await checkVideosExist(liveVideoUUID, true, 200) + await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) await checkVideoState(liveVideoUUID, VideoState.PUBLISHED) }) @@ -231,7 +232,7 @@ describe('Save replay setting', function () { await waitJobs(servers) // Live has been transcoded - await checkVideosExist(liveVideoUUID, true, 200) + await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) await checkVideoState(liveVideoUUID, VideoState.PUBLISHED) }) @@ -261,7 +262,7 @@ describe('Save replay setting', function () { await waitUntilLiveStarts(servers[0].url, servers[0].accessToken, liveVideoUUID) await waitJobs(servers) - await checkVideosExist(liveVideoUUID, true, 200) + await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) await Promise.all([ addVideoToBlacklist(servers[0].url, servers[0].accessToken, liveVideoUUID, 'bad live', true), @@ -272,8 +273,8 @@ describe('Save replay setting', function () { await checkVideosExist(liveVideoUUID, false) - await getVideo(servers[0].url, liveVideoUUID, 401) - await getVideo(servers[1].url, liveVideoUUID, 404) + await getVideo(servers[0].url, liveVideoUUID, HttpStatusCode.UNAUTHORIZED_401) + await getVideo(servers[1].url, liveVideoUUID, HttpStatusCode.NOT_FOUND_404) await checkLiveCleanup(servers[0], liveVideoUUID, [ 720 ]) }) @@ -287,7 +288,7 @@ describe('Save replay setting', function () { await waitUntilLiveStarts(servers[0].url, servers[0].accessToken, liveVideoUUID) await waitJobs(servers) - await checkVideosExist(liveVideoUUID, true, 200) + await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200) await Promise.all([ removeVideo(servers[0].url, servers[0].accessToken, liveVideoUUID), @@ -296,7 +297,7 @@ describe('Save replay setting', function () { await waitJobs(servers) - await checkVideosExist(liveVideoUUID, false, 404) + await checkVideosExist(liveVideoUUID, false, HttpStatusCode.NOT_FOUND_404) await checkLiveCleanup(servers[0], liveVideoUUID, []) }) })