X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Fvideo-playlists.ts;h=8db91a3f9821a6f1eddfbf70c45cbf226fe43d54;hb=fd3c2e87051f5029cdec39d877b576a62f48e219;hp=9d054b1765cd96fd11a22f8190f7aab322bd8b8f;hpb=254d3579f5338f5fd775c17d15cdfc37078bcfb4;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts index 9d054b176..8db91a3f9 100644 --- a/server/tests/api/check-params/video-playlists.ts +++ b/server/tests/api/check-params/video-playlists.ts @@ -1,20 +1,9 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' -import { HttpStatusCode } from '@shared/core-utils' -import { - checkBadCountPagination, - checkBadSortPagination, - checkBadStartPagination, - cleanupTests, - createSingleServer, - makeGetRequest, - PlaylistsCommand, - PeerTubeServer, - setAccessTokensToServers, - setDefaultVideoChannel -} from '@shared/extra-utils' +import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '@server/tests/shared' import { + HttpStatusCode, VideoPlaylistCreate, VideoPlaylistCreateResult, VideoPlaylistElementCreate, @@ -23,6 +12,15 @@ import { VideoPlaylistReorder, VideoPlaylistType } from '@shared/models' +import { + cleanupTests, + createSingleServer, + makeGetRequest, + PeerTubeServer, + PlaylistsCommand, + setAccessTokensToServers, + setDefaultVideoChannel +} from '@shared/server-commands' describe('Test video playlists API validator', function () { let server: PeerTubeServer @@ -119,7 +117,7 @@ describe('Test video playlists API validator', function () { await makeGetRequest({ url: server.url, path: accountPath, - statusCodeExpected: HttpStatusCode.NOT_FOUND_404, + expectedStatus: HttpStatusCode.NOT_FOUND_404, token: server.accessToken }) }) @@ -130,18 +128,18 @@ describe('Test video playlists API validator', function () { await makeGetRequest({ url: server.url, path: accountPath, - statusCodeExpected: HttpStatusCode.NOT_FOUND_404, + expectedStatus: HttpStatusCode.NOT_FOUND_404, token: server.accessToken }) }) it('Should success with the correct parameters', async function () { - await makeGetRequest({ url: server.url, path: globalPath, statusCodeExpected: HttpStatusCode.OK_200, token: server.accessToken }) - await makeGetRequest({ url: server.url, path: accountPath, statusCodeExpected: HttpStatusCode.OK_200, token: server.accessToken }) + await makeGetRequest({ url: server.url, path: globalPath, expectedStatus: HttpStatusCode.OK_200, token: server.accessToken }) + await makeGetRequest({ url: server.url, path: accountPath, expectedStatus: HttpStatusCode.OK_200, token: server.accessToken }) await makeGetRequest({ url: server.url, path: videoChannelPath, - statusCodeExpected: HttpStatusCode.OK_200, + expectedStatus: HttpStatusCode.OK_200, token: server.accessToken }) }) @@ -159,7 +157,7 @@ describe('Test video playlists API validator', function () { }) it('Should success with the correct parameters', async function () { - await makeGetRequest({ url: server.url, path: path + playlist.shortUUID + '/videos', statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path: path + playlist.shortUUID + '/videos', expectedStatus: HttpStatusCode.OK_200 }) }) }) @@ -211,7 +209,7 @@ describe('Test video playlists API validator', function () { } } const getUpdate = (params: any, playlistId: number | string) => { - return { ...params, playlistId: playlistId } + return { ...params, playlistId } } it('Should fail with an unauthenticated user', async function () { @@ -580,7 +578,7 @@ describe('Test video playlists API validator', function () { url: server.url, path, query: { videoIds: [ 1, 2 ] }, - statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 + expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) }) @@ -613,7 +611,7 @@ describe('Test video playlists API validator', function () { token: server.accessToken, path, query: { videoIds: [ 1, 2 ] }, - statusCodeExpected: HttpStatusCode.OK_200 + expectedStatus: HttpStatusCode.OK_200 }) }) })