X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fsingle-pod.js;h=fe388698f9b24407719a350eded938f06078dc09;hb=fce897f326af14406ced2f71a00ae89ff297a550;hp=6d7ebdc9b515241ef24c0a44f261a218fee5c072;hpb=6f0c39e2de400685b7baf8340b9e132f2659365a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/single-pod.js b/server/tests/api/single-pod.js index 6d7ebdc9b..fe388698f 100644 --- a/server/tests/api/single-pod.js +++ b/server/tests/api/single-pod.js @@ -70,6 +70,19 @@ describe('Test a single pod', function () { }) }) + it('Should list video languages', function (done) { + videosUtils.getVideoLanguages(server.url, function (err, res) { + if (err) throw err + + const languages = res.body + expect(Object.keys(languages)).to.have.length.above(5) + + expect(languages[3]).to.equal('Mandarin') + + done() + }) + }) + it('Should not have videos', function (done) { videosUtils.getVideosList(server.url, function (err, res) { if (err) throw err @@ -86,6 +99,7 @@ describe('Test a single pod', function () { const videoAttributes = { name: 'my super name', category: 2, + nsfw: true, licence: 6, tags: [ 'tag1', 'tag2', 'tag3' ] } @@ -109,6 +123,9 @@ describe('Test a single pod', 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.nsfw).to.be.truthy expect(video.description).to.equal('my super description') expect(video.podHost).to.equal('localhost:9001') expect(video.magnetUri).to.exist @@ -148,6 +165,9 @@ describe('Test a single pod', 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.nsfw).to.be.truthy expect(video.description).to.equal('my super description') expect(video.podHost).to.equal('localhost:9001') expect(video.magnetUri).to.exist @@ -191,6 +211,9 @@ describe('Test a single pod', 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.nsfw).to.be.truthy expect(video.description).to.equal('my super description') expect(video.podHost).to.equal('localhost:9001') expect(video.author).to.equal('root') @@ -250,6 +273,9 @@ describe('Test a single pod', 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.nsfw).to.be.truthy expect(video.description).to.equal('my super description') expect(video.podHost).to.equal('localhost:9001') expect(video.author).to.equal('root') @@ -347,6 +373,8 @@ describe('Test a single pod', function () { description: video + ' description', category: 2, licence: 1, + language: 1, + nsfw: true, tags: [ 'tag1', 'tag2', 'tag3' ], fixture: video } @@ -572,6 +600,8 @@ describe('Test a single pod', function () { name: 'my super video updated', category: 4, licence: 2, + language: 5, + nsfw: false, description: 'my super description updated', tags: [ 'tagup1', 'tagup2' ] } @@ -591,6 +621,9 @@ describe('Test a single pod', function () { expect(video.categoryLabel).to.equal('Art') expect(video.licence).to.equal(2) expect(video.licenceLabel).to.equal('Attribution - Share Alike') + expect(video.language).to.equal(5) + expect(video.languageLabel).to.equal('Arabic') + expect(video.nsfw).to.be.truthy expect(video.description).to.equal('my super description updated') expect(video.podHost).to.equal('localhost:9001') expect(video.author).to.equal('root') @@ -632,6 +665,9 @@ describe('Test a single pod', function () { expect(video.categoryLabel).to.equal('Art') expect(video.licence).to.equal(2) expect(video.licenceLabel).to.equal('Attribution - Share Alike') + expect(video.language).to.equal(5) + expect(video.languageLabel).to.equal('Arabic') + expect(video.nsfw).to.be.truthy expect(video.description).to.equal('my super description updated') expect(video.podHost).to.equal('localhost:9001') expect(video.author).to.equal('root') @@ -663,6 +699,9 @@ describe('Test a single pod', function () { expect(video.categoryLabel).to.equal('Art') expect(video.licence).to.equal(2) expect(video.licenceLabel).to.equal('Attribution - Share Alike') + expect(video.language).to.equal(5) + expect(video.languageLabel).to.equal('Arabic') + expect(video.nsfw).to.be.truthy expect(video.description).to.equal('hello everybody') expect(video.podHost).to.equal('localhost:9001') expect(video.author).to.equal('root')