aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/users.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/users.ts')
-rw-r--r--server/tests/api/check-params/users.ts12
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
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { User, UserRole } from '../../../../shared' 5import { User, UserRole, VideoCreateResult } from '../../../../shared'
6import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 6import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
7import { 7import {
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