diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-28 17:30:59 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-06-29 14:56:35 +0200 |
commit | d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb (patch) | |
tree | a4cb07318100031951c3dffc61f4f2cb95d2cbd0 /server/tests/api/check-params/users.ts | |
parent | 62ddc31a9e4b92d7d27898ccfc363f68ab044139 (diff) | |
download | PeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.tar.gz PeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.tar.zst PeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.zip |
Support short uuid for GET video/playlist
Diffstat (limited to 'server/tests/api/check-params/users.ts')
-rw-r--r-- | server/tests/api/check-params/users.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 36482ee17..70a872ce5 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { omit } from 'lodash' | 4 | import { omit } from 'lodash' |
5 | import { User, UserRole } from '../../../../shared' | 5 | import { User, UserRole, VideoCreateResult } from '../../../../shared' |
6 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 6 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' |
7 | import { | 7 | import { |
8 | addVideoChannel, | 8 | addVideoChannel, |
@@ -45,7 +45,7 @@ describe('Test users API validators', function () { | |||
45 | let userId: number | 45 | let userId: number |
46 | let rootId: number | 46 | let rootId: number |
47 | let moderatorId: number | 47 | let moderatorId: number |
48 | let videoId: number | 48 | let video: VideoCreateResult |
49 | let server: ServerInfo | 49 | let server: ServerInfo |
50 | let serverWithRegistrationDisabled: ServerInfo | 50 | let serverWithRegistrationDisabled: ServerInfo |
51 | let userAccessToken = '' | 51 | let userAccessToken = '' |
@@ -126,7 +126,7 @@ describe('Test users API validators', function () { | |||
126 | 126 | ||
127 | { | 127 | { |
128 | const res = await uploadVideo(server.url, server.accessToken, {}) | 128 | const res = await uploadVideo(server.url, server.accessToken, {}) |
129 | videoId = res.body.video.id | 129 | video = res.body.video |
130 | } | 130 | } |
131 | 131 | ||
132 | { | 132 | { |
@@ -829,7 +829,7 @@ describe('Test users API validators', function () { | |||
829 | 829 | ||
830 | describe('When getting my video rating', function () { | 830 | describe('When getting my video rating', function () { |
831 | it('Should fail with a non authenticated user', async function () { | 831 | it('Should fail with a non authenticated user', async function () { |
832 | await getMyUserVideoRating(server.url, 'fake_token', videoId, HttpStatusCode.UNAUTHORIZED_401) | 832 | await getMyUserVideoRating(server.url, 'fake_token', video.id, HttpStatusCode.UNAUTHORIZED_401) |
833 | }) | 833 | }) |
834 | 834 | ||
835 | it('Should fail with an incorrect video uuid', async function () { | 835 | it('Should fail with an incorrect video uuid', async function () { |
@@ -841,7 +841,9 @@ describe('Test users API validators', function () { | |||
841 | }) | 841 | }) |
842 | 842 | ||
843 | it('Should succeed with the correct parameters', async function () { | 843 | it('Should succeed with the correct parameters', async function () { |
844 | await getMyUserVideoRating(server.url, server.accessToken, videoId) | 844 | await getMyUserVideoRating(server.url, server.accessToken, video.id) |
845 | await getMyUserVideoRating(server.url, server.accessToken, video.uuid) | ||
846 | await getMyUserVideoRating(server.url, server.accessToken, video.shortUUID) | ||
845 | }) | 847 | }) |
846 | }) | 848 | }) |
847 | 849 | ||