From 066e94c5382a761180c7d82fa24b31b66dbeaca4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 13 Mar 2018 10:24:28 +0100 Subject: Add "local" videos in menu --- server/tests/api/videos/multiple-servers.ts | 32 ++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'server/tests/api/videos') diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index 3f6b82c50..42a1241f7 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts @@ -15,7 +15,7 @@ import { dateIsValid, doubleFollow, flushAndRunMultipleServers, - flushTests, + flushTests, getLocalVideos, getVideo, getVideoChannelsList, getVideosList, @@ -349,6 +349,36 @@ describe('Test multiple servers', function () { }) }) + describe('It should list local videos', function () { + it('Should list only local videos on server 1', async function () { + const { body } = await getLocalVideos(servers[0].url) + + expect(body.total).to.equal(1) + expect(body.data).to.be.an('array') + expect(body.data.length).to.equal(1) + expect(body.data[0].name).to.equal('my super name for server 1') + }) + + it('Should list only local videos on server 2', async function () { + const { body } = await getLocalVideos(servers[1].url) + + expect(body.total).to.equal(1) + expect(body.data).to.be.an('array') + expect(body.data.length).to.equal(1) + expect(body.data[0].name).to.equal('my super name for server 2') + }) + + it('Should list only local videos on server 3', async function () { + const { body } = await getLocalVideos(servers[2].url) + + expect(body.total).to.equal(2) + expect(body.data).to.be.an('array') + expect(body.data.length).to.equal(2) + expect(body.data[0].name).to.equal('my super name for server 3') + expect(body.data[1].name).to.equal('my super name for server 3-2') + }) + }) + describe('Should seed the uploaded video', function () { it('Should add the file 1 by asking server 3', async function () { this.timeout(10000) -- cgit v1.2.3