From 9d3ef9fe052ed29bd67566754cb28662bd122234 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 23 Apr 2018 14:39:52 +0200 Subject: Use ISO 639 for languages --- server/tests/api/check-params/videos.ts | 8 ++++---- server/tests/api/server/follows.ts | 2 +- server/tests/api/server/handle-down.ts | 4 ++-- server/tests/api/videos/multiple-servers.ts | 20 ++++++++++---------- server/tests/api/videos/single-server.ts | 14 +++++++------- 5 files changed, 24 insertions(+), 24 deletions(-) (limited to 'server/tests/api') 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 () { name: 'my super name', category: 5, licence: 1, - language: 6, + language: 'pt', nsfw: false, commentsEnabled: true, description: 'my super description', @@ -151,7 +151,7 @@ describe('Test videos API validator', function () { }) it('Should fail with a bad language', async function () { - const fields = immutableAssign(baseCorrectParams, { language: 125 }) + const fields = immutableAssign(baseCorrectParams, { language: 'a'.repeat(15) }) const attaches = baseCorrectAttaches await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches }) @@ -359,7 +359,7 @@ describe('Test videos API validator', function () { name: 'my super name', category: 5, licence: 2, - language: 6, + language: 'pt', nsfw: false, commentsEnabled: false, description: 'my super description', @@ -413,7 +413,7 @@ describe('Test videos API validator', function () { }) it('Should fail with a bad language', async function () { - const fields = immutableAssign(baseCorrectParams, { language: 125 }) + const fields = immutableAssign(baseCorrectParams, { language: 'a'.repeat(15) }) await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields }) }) 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 () { name: 'server3-4', category: 2, licence: 6, - language: 3, + language: 'zh', nsfw: true, description: 'my super description', 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 () { name: 'my super name for server 1', category: 5, licence: 4, - language: 9, + language: 'ja', nsfw: true, privacy: VideoPrivacy.PUBLIC, description: 'my super description for server 1', @@ -49,7 +49,7 @@ describe('Test handle downs', function () { name: 'my super name for server 1', category: 5, licence: 4, - language: 9, + language: 'ja', nsfw: true, description: 'my super description for server 1', 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 () { name: 'my super name for server 1', category: 5, licence: 4, - language: 9, + language: 'ja', nsfw: true, description: 'my super description for server 1', support: 'my super support text for server 1', @@ -108,7 +108,7 @@ describe('Test multiple servers', function () { name: 'my super name for server 1', category: 5, licence: 4, - language: 9, + language: 'ja', nsfw: true, description: 'my super description for server 1', support: 'my super support text for server 1', @@ -159,7 +159,7 @@ describe('Test multiple servers', function () { name: 'my super name for server 2', category: 4, licence: 3, - language: 11, + language: 'de', nsfw: true, description: 'my super description for server 2', support: 'my super support text for server 2', @@ -180,7 +180,7 @@ describe('Test multiple servers', function () { name: 'my super name for server 2', category: 4, licence: 3, - language: 11, + language: 'de', nsfw: true, description: 'my super description for server 2', support: 'my super support text for server 2', @@ -238,7 +238,7 @@ describe('Test multiple servers', function () { name: 'my super name for server 3', category: 6, licence: 5, - language: 11, + language: 'de', nsfw: true, description: 'my super description for server 3', support: 'my super support text for server 3', @@ -251,7 +251,7 @@ describe('Test multiple servers', function () { name: 'my super name for server 3-2', category: 7, licence: 6, - language: 12, + language: 'ko', nsfw: false, description: 'my super description for server 3-2', support: 'my super support text for server 3-2', @@ -286,7 +286,7 @@ describe('Test multiple servers', function () { name: 'my super name for server 3', category: 6, licence: 5, - language: 11, + language: 'de', nsfw: true, description: 'my super description for server 3', support: 'my super support text for server 3', @@ -318,7 +318,7 @@ describe('Test multiple servers', function () { name: 'my super name for server 3-2', category: 7, licence: 6, - language: 12, + language: 'ko', nsfw: false, description: 'my super description for server 3-2', support: 'my super support text for server 3-2', @@ -597,7 +597,7 @@ describe('Test multiple servers', function () { name: 'my super video updated', category: 10, licence: 7, - language: 13, + language: 'fr', nsfw: true, description: 'my super description updated', support: 'my super support text updated', @@ -626,7 +626,7 @@ describe('Test multiple servers', function () { name: 'my super video updated', category: 10, licence: 7, - language: 13, + language: 'fr', nsfw: true, description: 'my super description updated', 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 () { name: 'my super name', category: 2, licence: 6, - language: 3, + language: 'zh', nsfw: true, description: 'my super description', support: 'my super support text', @@ -54,7 +54,7 @@ describe('Test a single server', function () { name: 'my super video updated', category: 4, licence: 2, - language: 5, + language: 'ar', nsfw: false, description: 'my super description updated', support: 'my super support text updated', @@ -115,7 +115,7 @@ describe('Test a single server', function () { const languages = res.body expect(Object.keys(languages)).to.have.length.above(5) - expect(languages[3]).to.equal('Mandarin') + expect(languages['ru']).to.equal('Russian') }) it('Should list video privacies', async function () { @@ -222,8 +222,8 @@ describe('Test a single server', function () { // expect(video.categoryLabel).to.equal('Films') // expect(video.licence).to.equal(6) // expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives') - // expect(video.language).to.equal(3) - // expect(video.languageLabel).to.equal('Mandarin') + // expect(video.language).to.equal('zh') + // expect(video.languageLabel).to.equal('Chinese') // expect(video.nsfw).to.be.ok // expect(video.description).to.equal('my super description') // expect(video.account.name).to.equal('root') @@ -292,7 +292,7 @@ describe('Test a single server', function () { description: video + ' description', category: 2, licence: 1, - language: 1, + language: 'en', nsfw: true, tags: [ 'tag1', 'tag2', 'tag3' ], fixture: video @@ -458,7 +458,7 @@ describe('Test a single server', function () { name: 'my super video updated', category: 4, licence: 2, - language: 5, + language: 'ar', nsfw: false, description: 'my super description updated', commentsEnabled: false, -- cgit v1.2.3