aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/video-channels.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-15 14:46:26 +0100
committerChocobozzz <me@florianbigard.com>2018-02-15 15:29:07 +0100
commit2422c46b27790d94fd29a7092170cee5a1b56008 (patch)
treed5c1942ce20cadb27a551d87c789edfe92f5b105 /server/tests/api/check-params/video-channels.ts
parent34cbef8c6cc912143a421413bdd832c4adcc556a (diff)
downloadPeerTube-2422c46b27790d94fd29a7092170cee5a1b56008.tar.gz
PeerTube-2422c46b27790d94fd29a7092170cee5a1b56008.tar.zst
PeerTube-2422c46b27790d94fd29a7092170cee5a1b56008.zip
Implement support field in video and video channel
Diffstat (limited to 'server/tests/api/check-params/video-channels.ts')
-rw-r--r--server/tests/api/check-params/video-channels.ts15
1 files changed, 13 insertions, 2 deletions
diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts
index d073e28f0..43c5462ee 100644
--- a/server/tests/api/check-params/video-channels.ts
+++ b/server/tests/api/check-params/video-channels.ts
@@ -62,7 +62,8 @@ describe('Test videos API validator', function () {
62 describe('When adding a video channel', function () { 62 describe('When adding a video channel', function () {
63 const baseCorrectParams = { 63 const baseCorrectParams = {
64 name: 'hello', 64 name: 'hello',
65 description: 'super description' 65 description: 'super description',
66 support: 'super support text'
66 } 67 }
67 68
68 it('Should fail with a non authenticated user', async function () { 69 it('Should fail with a non authenticated user', async function () {
@@ -89,13 +90,18 @@ describe('Test videos API validator', function () {
89 await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) 90 await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
90 }) 91 })
91 92
93 it('Should fail with a long support text', async function () {
94 const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(70) })
95 await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
96 })
97
92 it('Should succeed with the correct parameters', async function () { 98 it('Should succeed with the correct parameters', async function () {
93 await makePostBodyRequest({ 99 await makePostBodyRequest({
94 url: server.url, 100 url: server.url,
95 path, 101 path,
96 token: server.accessToken, 102 token: server.accessToken,
97 fields: baseCorrectParams, 103 fields: baseCorrectParams,
98 statusCodeExpected: 204 104 statusCodeExpected: 200
99 }) 105 })
100 }) 106 })
101 }) 107 })
@@ -143,6 +149,11 @@ describe('Test videos API validator', function () {
143 await makePutBodyRequest({ url: server.url, path: path + '/' + videoChannelId, token: server.accessToken, fields }) 149 await makePutBodyRequest({ url: server.url, path: path + '/' + videoChannelId, token: server.accessToken, fields })
144 }) 150 })
145 151
152 it('Should fail with a long support text', async function () {
153 const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(70) })
154 await makePutBodyRequest({ url: server.url, path: path + '/' + videoChannelId, token: server.accessToken, fields })
155 })
156
146 it('Should succeed with the correct parameters', async function () { 157 it('Should succeed with the correct parameters', async function () {
147 await makePutBodyRequest({ 158 await makePutBodyRequest({
148 url: server.url, 159 url: server.url,