diff options
author | Chocobozzz <me@florianbigard.com> | 2018-04-23 14:39:52 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-23 14:39:52 +0200 |
commit | 9d3ef9fe052ed29bd67566754cb28662bd122234 (patch) | |
tree | 7b704dbc0b2c8b4ca18bef2409d640d0019c3d0a /server/tests/api | |
parent | 2a2c19dfef7a9aa313c6ca0798f271c9a63449a9 (diff) | |
download | PeerTube-9d3ef9fe052ed29bd67566754cb28662bd122234.tar.gz PeerTube-9d3ef9fe052ed29bd67566754cb28662bd122234.tar.zst PeerTube-9d3ef9fe052ed29bd67566754cb28662bd122234.zip |
Use ISO 639 for languages
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/check-params/videos.ts | 8 | ||||
-rw-r--r-- | server/tests/api/server/follows.ts | 2 | ||||
-rw-r--r-- | server/tests/api/server/handle-down.ts | 4 | ||||
-rw-r--r-- | server/tests/api/videos/multiple-servers.ts | 20 | ||||
-rw-r--r-- | server/tests/api/videos/single-server.ts | 14 |
5 files changed, 24 insertions, 24 deletions
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 1d19daa60..da41f515b 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts | |||
@@ -105,7 +105,7 @@ describe('Test videos API validator', function () { | |||
105 | name: 'my super name', | 105 | name: 'my super name', |
106 | category: 5, | 106 | category: 5, |
107 | licence: 1, | 107 | licence: 1, |
108 | language: 6, | 108 | language: 'pt', |
109 | nsfw: false, | 109 | nsfw: false, |
110 | commentsEnabled: true, | 110 | commentsEnabled: true, |
111 | description: 'my super description', | 111 | description: 'my super description', |
@@ -151,7 +151,7 @@ describe('Test videos API validator', function () { | |||
151 | }) | 151 | }) |
152 | 152 | ||
153 | it('Should fail with a bad language', async function () { | 153 | it('Should fail with a bad language', async function () { |
154 | const fields = immutableAssign(baseCorrectParams, { language: 125 }) | 154 | const fields = immutableAssign(baseCorrectParams, { language: 'a'.repeat(15) }) |
155 | const attaches = baseCorrectAttaches | 155 | const attaches = baseCorrectAttaches |
156 | 156 | ||
157 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) | 157 | await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) |
@@ -359,7 +359,7 @@ describe('Test videos API validator', function () { | |||
359 | name: 'my super name', | 359 | name: 'my super name', |
360 | category: 5, | 360 | category: 5, |
361 | licence: 2, | 361 | licence: 2, |
362 | language: 6, | 362 | language: 'pt', |
363 | nsfw: false, | 363 | nsfw: false, |
364 | commentsEnabled: false, | 364 | commentsEnabled: false, |
365 | description: 'my super description', | 365 | description: 'my super description', |
@@ -413,7 +413,7 @@ describe('Test videos API validator', function () { | |||
413 | }) | 413 | }) |
414 | 414 | ||
415 | it('Should fail with a bad language', async function () { | 415 | it('Should fail with a bad language', async function () { |
416 | const fields = immutableAssign(baseCorrectParams, { language: 125 }) | 416 | const fields = immutableAssign(baseCorrectParams, { language: 'a'.repeat(15) }) |
417 | 417 | ||
418 | await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) | 418 | await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) |
419 | }) | 419 | }) |
diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts index 010b488d8..9d619a7de 100644 --- a/server/tests/api/server/follows.ts +++ b/server/tests/api/server/follows.ts | |||
@@ -277,7 +277,7 @@ describe('Test follows', function () { | |||
277 | name: 'server3-4', | 277 | name: 'server3-4', |
278 | category: 2, | 278 | category: 2, |
279 | licence: 6, | 279 | licence: 6, |
280 | language: 3, | 280 | language: 'zh', |
281 | nsfw: true, | 281 | nsfw: true, |
282 | description: 'my super description', | 282 | description: 'my super description', |
283 | support: 'my super support text', | 283 | support: 'my super support text', |
diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts index f5ff3e9e5..889825936 100644 --- a/server/tests/api/server/handle-down.ts +++ b/server/tests/api/server/handle-down.ts | |||
@@ -32,7 +32,7 @@ describe('Test handle downs', function () { | |||
32 | name: 'my super name for server 1', | 32 | name: 'my super name for server 1', |
33 | category: 5, | 33 | category: 5, |
34 | licence: 4, | 34 | licence: 4, |
35 | language: 9, | 35 | language: 'ja', |
36 | nsfw: true, | 36 | nsfw: true, |
37 | privacy: VideoPrivacy.PUBLIC, | 37 | privacy: VideoPrivacy.PUBLIC, |
38 | description: 'my super description for server 1', | 38 | description: 'my super description for server 1', |
@@ -49,7 +49,7 @@ describe('Test handle downs', function () { | |||
49 | name: 'my super name for server 1', | 49 | name: 'my super name for server 1', |
50 | category: 5, | 50 | category: 5, |
51 | licence: 4, | 51 | licence: 4, |
52 | language: 9, | 52 | language: 'ja', |
53 | nsfw: true, | 53 | nsfw: true, |
54 | description: 'my super description for server 1', | 54 | description: 'my super description for server 1', |
55 | support: 'my super support text for server 1', | 55 | support: 'my super support text for server 1', |
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index e31c7febd..2563939ec 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts | |||
@@ -89,7 +89,7 @@ describe('Test multiple servers', function () { | |||
89 | name: 'my super name for server 1', | 89 | name: 'my super name for server 1', |
90 | category: 5, | 90 | category: 5, |
91 | licence: 4, | 91 | licence: 4, |
92 | language: 9, | 92 | language: 'ja', |
93 | nsfw: true, | 93 | nsfw: true, |
94 | description: 'my super description for server 1', | 94 | description: 'my super description for server 1', |
95 | support: 'my super support text for server 1', | 95 | support: 'my super support text for server 1', |
@@ -108,7 +108,7 @@ describe('Test multiple servers', function () { | |||
108 | name: 'my super name for server 1', | 108 | name: 'my super name for server 1', |
109 | category: 5, | 109 | category: 5, |
110 | licence: 4, | 110 | licence: 4, |
111 | language: 9, | 111 | language: 'ja', |
112 | nsfw: true, | 112 | nsfw: true, |
113 | description: 'my super description for server 1', | 113 | description: 'my super description for server 1', |
114 | support: 'my super support text for server 1', | 114 | support: 'my super support text for server 1', |
@@ -159,7 +159,7 @@ describe('Test multiple servers', function () { | |||
159 | name: 'my super name for server 2', | 159 | name: 'my super name for server 2', |
160 | category: 4, | 160 | category: 4, |
161 | licence: 3, | 161 | licence: 3, |
162 | language: 11, | 162 | language: 'de', |
163 | nsfw: true, | 163 | nsfw: true, |
164 | description: 'my super description for server 2', | 164 | description: 'my super description for server 2', |
165 | support: 'my super support text for server 2', | 165 | support: 'my super support text for server 2', |
@@ -180,7 +180,7 @@ describe('Test multiple servers', function () { | |||
180 | name: 'my super name for server 2', | 180 | name: 'my super name for server 2', |
181 | category: 4, | 181 | category: 4, |
182 | licence: 3, | 182 | licence: 3, |
183 | language: 11, | 183 | language: 'de', |
184 | nsfw: true, | 184 | nsfw: true, |
185 | description: 'my super description for server 2', | 185 | description: 'my super description for server 2', |
186 | support: 'my super support text for server 2', | 186 | support: 'my super support text for server 2', |
@@ -238,7 +238,7 @@ describe('Test multiple servers', function () { | |||
238 | name: 'my super name for server 3', | 238 | name: 'my super name for server 3', |
239 | category: 6, | 239 | category: 6, |
240 | licence: 5, | 240 | licence: 5, |
241 | language: 11, | 241 | language: 'de', |
242 | nsfw: true, | 242 | nsfw: true, |
243 | description: 'my super description for server 3', | 243 | description: 'my super description for server 3', |
244 | support: 'my super support text for server 3', | 244 | support: 'my super support text for server 3', |
@@ -251,7 +251,7 @@ describe('Test multiple servers', function () { | |||
251 | name: 'my super name for server 3-2', | 251 | name: 'my super name for server 3-2', |
252 | category: 7, | 252 | category: 7, |
253 | licence: 6, | 253 | licence: 6, |
254 | language: 12, | 254 | language: 'ko', |
255 | nsfw: false, | 255 | nsfw: false, |
256 | description: 'my super description for server 3-2', | 256 | description: 'my super description for server 3-2', |
257 | support: 'my super support text for server 3-2', | 257 | support: 'my super support text for server 3-2', |
@@ -286,7 +286,7 @@ describe('Test multiple servers', function () { | |||
286 | name: 'my super name for server 3', | 286 | name: 'my super name for server 3', |
287 | category: 6, | 287 | category: 6, |
288 | licence: 5, | 288 | licence: 5, |
289 | language: 11, | 289 | language: 'de', |
290 | nsfw: true, | 290 | nsfw: true, |
291 | description: 'my super description for server 3', | 291 | description: 'my super description for server 3', |
292 | support: 'my super support text for server 3', | 292 | support: 'my super support text for server 3', |
@@ -318,7 +318,7 @@ describe('Test multiple servers', function () { | |||
318 | name: 'my super name for server 3-2', | 318 | name: 'my super name for server 3-2', |
319 | category: 7, | 319 | category: 7, |
320 | licence: 6, | 320 | licence: 6, |
321 | language: 12, | 321 | language: 'ko', |
322 | nsfw: false, | 322 | nsfw: false, |
323 | description: 'my super description for server 3-2', | 323 | description: 'my super description for server 3-2', |
324 | support: 'my super support text for server 3-2', | 324 | support: 'my super support text for server 3-2', |
@@ -597,7 +597,7 @@ describe('Test multiple servers', function () { | |||
597 | name: 'my super video updated', | 597 | name: 'my super video updated', |
598 | category: 10, | 598 | category: 10, |
599 | licence: 7, | 599 | licence: 7, |
600 | language: 13, | 600 | language: 'fr', |
601 | nsfw: true, | 601 | nsfw: true, |
602 | description: 'my super description updated', | 602 | description: 'my super description updated', |
603 | support: 'my super support text updated', | 603 | support: 'my super support text updated', |
@@ -626,7 +626,7 @@ describe('Test multiple servers', function () { | |||
626 | name: 'my super video updated', | 626 | name: 'my super video updated', |
627 | category: 10, | 627 | category: 10, |
628 | licence: 7, | 628 | licence: 7, |
629 | language: 13, | 629 | language: 'fr', |
630 | nsfw: true, | 630 | nsfw: true, |
631 | description: 'my super description updated', | 631 | description: 'my super description updated', |
632 | support: 'my super support text updated', | 632 | support: 'my super support text updated', |
diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts index 7c4bdf8bc..5e163e9df 100644 --- a/server/tests/api/videos/single-server.ts +++ b/server/tests/api/videos/single-server.ts | |||
@@ -23,7 +23,7 @@ describe('Test a single server', function () { | |||
23 | name: 'my super name', | 23 | name: 'my super name', |
24 | category: 2, | 24 | category: 2, |
25 | licence: 6, | 25 | licence: 6, |
26 | language: 3, | 26 | language: 'zh', |
27 | nsfw: true, | 27 | nsfw: true, |
28 | description: 'my super description', | 28 | description: 'my super description', |
29 | support: 'my super support text', | 29 | support: 'my super support text', |
@@ -54,7 +54,7 @@ describe('Test a single server', function () { | |||
54 | name: 'my super video updated', | 54 | name: 'my super video updated', |
55 | category: 4, | 55 | category: 4, |
56 | licence: 2, | 56 | licence: 2, |
57 | language: 5, | 57 | language: 'ar', |
58 | nsfw: false, | 58 | nsfw: false, |
59 | description: 'my super description updated', | 59 | description: 'my super description updated', |
60 | support: 'my super support text updated', | 60 | support: 'my super support text updated', |
@@ -115,7 +115,7 @@ describe('Test a single server', function () { | |||
115 | const languages = res.body | 115 | const languages = res.body |
116 | expect(Object.keys(languages)).to.have.length.above(5) | 116 | expect(Object.keys(languages)).to.have.length.above(5) |
117 | 117 | ||
118 | expect(languages[3]).to.equal('Mandarin') | 118 | expect(languages['ru']).to.equal('Russian') |
119 | }) | 119 | }) |
120 | 120 | ||
121 | it('Should list video privacies', async function () { | 121 | it('Should list video privacies', async function () { |
@@ -222,8 +222,8 @@ describe('Test a single server', function () { | |||
222 | // expect(video.categoryLabel).to.equal('Films') | 222 | // expect(video.categoryLabel).to.equal('Films') |
223 | // expect(video.licence).to.equal(6) | 223 | // expect(video.licence).to.equal(6) |
224 | // expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives') | 224 | // expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives') |
225 | // expect(video.language).to.equal(3) | 225 | // expect(video.language).to.equal('zh') |
226 | // expect(video.languageLabel).to.equal('Mandarin') | 226 | // expect(video.languageLabel).to.equal('Chinese') |
227 | // expect(video.nsfw).to.be.ok | 227 | // expect(video.nsfw).to.be.ok |
228 | // expect(video.description).to.equal('my super description') | 228 | // expect(video.description).to.equal('my super description') |
229 | // expect(video.account.name).to.equal('root') | 229 | // expect(video.account.name).to.equal('root') |
@@ -292,7 +292,7 @@ describe('Test a single server', function () { | |||
292 | description: video + ' description', | 292 | description: video + ' description', |
293 | category: 2, | 293 | category: 2, |
294 | licence: 1, | 294 | licence: 1, |
295 | language: 1, | 295 | language: 'en', |
296 | nsfw: true, | 296 | nsfw: true, |
297 | tags: [ 'tag1', 'tag2', 'tag3' ], | 297 | tags: [ 'tag1', 'tag2', 'tag3' ], |
298 | fixture: video | 298 | fixture: video |
@@ -458,7 +458,7 @@ describe('Test a single server', function () { | |||
458 | name: 'my super video updated', | 458 | name: 'my super video updated', |
459 | category: 4, | 459 | category: 4, |
460 | licence: 2, | 460 | licence: 2, |
461 | language: 5, | 461 | language: 'ar', |
462 | nsfw: false, | 462 | nsfw: false, |
463 | description: 'my super description updated', | 463 | description: 'my super description updated', |
464 | commentsEnabled: false, | 464 | commentsEnabled: false, |