X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Ffollow-constraints.ts;h=455fbc76298c12f9961c7b6b04583c3e82c35d7a;hb=b211106695bb82f6c32e53306081b5262c3d109d;hp=4ed593b7674f6d93ed39e2870cf0ebc3610241e4;hpb=254d3579f5338f5fd775c17d15cdfc37078bcfb4;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/follow-constraints.ts b/server/tests/api/server/follow-constraints.ts index 4ed593b76..455fbc762 100644 --- a/server/tests/api/server/follow-constraints.ts +++ b/server/tests/api/server/follow-constraints.ts @@ -2,9 +2,8 @@ import 'mocha' import * as chai from 'chai' -import { HttpStatusCode } from '@shared/core-utils' -import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' -import { PeerTubeProblemDocument, ServerErrorCode } from '@shared/models' +import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands' +import { HttpStatusCode, PeerTubeProblemDocument, ServerErrorCode } from '@shared/models' const expect = chai.expect @@ -15,7 +14,7 @@ describe('Test follow constraints', function () { let userToken: string before(async function () { - this.timeout(90000) + this.timeout(240000) servers = await createMultipleServers(2) @@ -54,30 +53,30 @@ describe('Test follow constraints', function () { }) it('Should list local account videos', async function () { - const { total, data } = await servers[0].videos.listByAccount({ accountName: 'root@localhost:' + servers[0].port }) + const { total, data } = await servers[0].videos.listByAccount({ handle: 'root@localhost:' + servers[0].port }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) }) it('Should list remote account videos', async function () { - const { total, data } = await servers[0].videos.listByAccount({ accountName: 'root@localhost:' + servers[1].port }) + const { total, data } = await servers[0].videos.listByAccount({ handle: 'root@localhost:' + servers[1].port }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) }) it('Should list local channel videos', async function () { - const videoChannelName = 'root_channel@localhost:' + servers[0].port - const { total, data } = await servers[0].videos.listByChannel({ videoChannelName }) + const handle = 'root_channel@localhost:' + servers[0].port + const { total, data } = await servers[0].videos.listByChannel({ handle }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) }) it('Should list remote channel videos', async function () { - const videoChannelName = 'root_channel@localhost:' + servers[1].port - const { total, data } = await servers[0].videos.listByChannel({ videoChannelName }) + const handle = 'root_channel@localhost:' + servers[1].port + const { total, data } = await servers[0].videos.listByChannel({ handle }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) @@ -94,30 +93,30 @@ describe('Test follow constraints', function () { }) it('Should list local account videos', async function () { - const { total, data } = await servers[0].videos.listByAccount({ token: userToken, accountName: 'root@localhost:' + servers[0].port }) + const { total, data } = await servers[0].videos.listByAccount({ token: userToken, handle: 'root@localhost:' + servers[0].port }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) }) it('Should list remote account videos', async function () { - const { total, data } = await servers[0].videos.listByAccount({ token: userToken, accountName: 'root@localhost:' + servers[1].port }) + const { total, data } = await servers[0].videos.listByAccount({ token: userToken, handle: 'root@localhost:' + servers[1].port }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) }) it('Should list local channel videos', async function () { - const videoChannelName = 'root_channel@localhost:' + servers[0].port - const { total, data } = await servers[0].videos.listByChannel({ token: userToken, videoChannelName }) + const handle = 'root_channel@localhost:' + servers[0].port + const { total, data } = await servers[0].videos.listByChannel({ token: userToken, handle }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) }) it('Should list remote channel videos', async function () { - const videoChannelName = 'root_channel@localhost:' + servers[1].port - const { total, data } = await servers[0].videos.listByChannel({ token: userToken, videoChannelName }) + const handle = 'root_channel@localhost:' + servers[1].port + const { total, data } = await servers[0].videos.listByChannel({ token: userToken, handle }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) @@ -157,8 +156,8 @@ describe('Test follow constraints', function () { it('Should list local account videos', async function () { const { total, data } = await servers[0].videos.listByAccount({ - token: undefined, - accountName: 'root@localhost:' + servers[0].port + token: null, + handle: 'root@localhost:' + servers[0].port }) expect(total).to.equal(1) @@ -167,8 +166,8 @@ describe('Test follow constraints', function () { it('Should not list remote account videos', async function () { const { total, data } = await servers[0].videos.listByAccount({ - token: undefined, - accountName: 'root@localhost:' + servers[1].port + token: null, + handle: 'root@localhost:' + servers[1].port }) expect(total).to.equal(0) @@ -176,16 +175,16 @@ describe('Test follow constraints', function () { }) it('Should list local channel videos', async function () { - const videoChannelName = 'root_channel@localhost:' + servers[0].port - const { total, data } = await servers[0].videos.listByChannel({ token: undefined, videoChannelName }) + const handle = 'root_channel@localhost:' + servers[0].port + const { total, data } = await servers[0].videos.listByChannel({ token: null, handle }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) }) it('Should not list remote channel videos', async function () { - const videoChannelName = 'root_channel@localhost:' + servers[1].port - const { total, data } = await servers[0].videos.listByChannel({ token: undefined, videoChannelName }) + const handle = 'root_channel@localhost:' + servers[1].port + const { total, data } = await servers[0].videos.listByChannel({ token: null, handle }) expect(total).to.equal(0) expect(data).to.have.lengthOf(0) @@ -202,30 +201,30 @@ describe('Test follow constraints', function () { }) it('Should list local account videos', async function () { - const { total, data } = await servers[0].videos.listByAccount({ token: userToken, accountName: 'root@localhost:' + servers[0].port }) + const { total, data } = await servers[0].videos.listByAccount({ token: userToken, handle: 'root@localhost:' + servers[0].port }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) }) it('Should list remote account videos', async function () { - const { total, data } = await servers[0].videos.listByAccount({ token: userToken, accountName: 'root@localhost:' + servers[1].port }) + const { total, data } = await servers[0].videos.listByAccount({ token: userToken, handle: 'root@localhost:' + servers[1].port }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) }) it('Should list local channel videos', async function () { - const videoChannelName = 'root_channel@localhost:' + servers[0].port - const { total, data } = await servers[0].videos.listByChannel({ token: userToken, videoChannelName }) + const handle = 'root_channel@localhost:' + servers[0].port + const { total, data } = await servers[0].videos.listByChannel({ token: userToken, handle }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1) }) it('Should list remote channel videos', async function () { - const videoChannelName = 'root_channel@localhost:' + servers[1].port - const { total, data } = await servers[0].videos.listByChannel({ token: userToken, videoChannelName }) + const handle = 'root_channel@localhost:' + servers[1].port + const { total, data } = await servers[0].videos.listByChannel({ token: userToken, handle }) expect(total).to.equal(1) expect(data).to.have.lengthOf(1)