aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r--server/tests/api/check-params/accounts.ts4
-rw-r--r--server/tests/api/check-params/video-channels.ts10
-rw-r--r--server/tests/api/check-params/videos.ts6
3 files changed, 8 insertions, 12 deletions
diff --git a/server/tests/api/check-params/accounts.ts b/server/tests/api/check-params/accounts.ts
index 50dc0804e..9e0b1e35c 100644
--- a/server/tests/api/check-params/accounts.ts
+++ b/server/tests/api/check-params/accounts.ts
@@ -35,8 +35,8 @@ describe('Test users API validators', function () {
35 }) 35 })
36 36
37 describe('When getting an account', function () { 37 describe('When getting an account', function () {
38 it('Should return 404 with a non existing id', async function () { 38 it('Should return 404 with a non existing name', async function () {
39 await getAccount(server.url, 4545454, 404) 39 await getAccount(server.url, 'arfaze', 404)
40 }) 40 })
41 }) 41 })
42 42
diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts
index 56b990be6..5080af2c9 100644
--- a/server/tests/api/check-params/video-channels.ts
+++ b/server/tests/api/check-params/video-channels.ts
@@ -7,7 +7,8 @@ import {
7 createUser, 7 createUser,
8 deleteVideoChannel, 8 deleteVideoChannel,
9 flushTests, 9 flushTests,
10 getAccountVideoChannelsList, getMyUserInformation, 10 getAccountVideoChannelsList,
11 getMyUserInformation,
11 getVideoChannelsList, 12 getVideoChannelsList,
12 immutableAssign, 13 immutableAssign,
13 killallServers, 14 killallServers,
@@ -20,7 +21,6 @@ import {
20 userLogin 21 userLogin
21} from '../../utils' 22} from '../../utils'
22import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params' 23import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
23import { getAccountsList } from '../../utils/users/accounts'
24import { User } from '../../../../shared/models/users' 24import { User } from '../../../../shared/models/users'
25 25
26const expect = chai.expect 26const expect = chai.expect
@@ -74,12 +74,8 @@ describe('Test video channels API validator', function () {
74 }) 74 })
75 75
76 describe('When listing account video channels', function () { 76 describe('When listing account video channels', function () {
77 it('Should fail with bad account', async function () {
78 await getAccountVideoChannelsList(server.url, 'hello', 400)
79 })
80
81 it('Should fail with a unknown account', async function () { 77 it('Should fail with a unknown account', async function () {
82 await getAccountVideoChannelsList(server.url, 154, 404) 78 await getAccountVideoChannelsList(server.url, 'unknown', 404)
83 }) 79 })
84 }) 80 })
85 81
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts
index c81e9752e..7b40b91e7 100644
--- a/server/tests/api/check-params/videos.ts
+++ b/server/tests/api/check-params/videos.ts
@@ -18,7 +18,7 @@ describe('Test videos API validator', function () {
18 const path = '/api/v1/videos/' 18 const path = '/api/v1/videos/'
19 let server: ServerInfo 19 let server: ServerInfo
20 let userAccessToken = '' 20 let userAccessToken = ''
21 let accountUUID: string 21 let accountName: string
22 let channelId: number 22 let channelId: number
23 let channelUUID: string 23 let channelUUID: string
24 let videoId 24 let videoId
@@ -43,7 +43,7 @@ describe('Test videos API validator', function () {
43 const res = await getMyUserInformation(server.url, server.accessToken) 43 const res = await getMyUserInformation(server.url, server.accessToken)
44 channelId = res.body.videoChannels[ 0 ].id 44 channelId = res.body.videoChannels[ 0 ].id
45 channelUUID = res.body.videoChannels[ 0 ].uuid 45 channelUUID = res.body.videoChannels[ 0 ].uuid
46 accountUUID = res.body.account.uuid 46 accountName = res.body.account.name + '@' + res.body.account.host
47 } 47 }
48 }) 48 })
49 49
@@ -116,7 +116,7 @@ describe('Test videos API validator', function () {
116 let path: string 116 let path: string
117 117
118 before(async function () { 118 before(async function () {
119 path = '/api/v1/accounts/' + accountUUID + '/videos' 119 path = '/api/v1/accounts/' + accountName + '/videos'
120 }) 120 })
121 121
122 it('Should fail with a bad start pagination', async function () { 122 it('Should fail with a bad start pagination', async function () {