From a54618880c394ad7571f3f3222dc96ec2dd10d9a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 9 Jul 2021 11:21:30 +0200 Subject: Introduce channels command --- server/tests/api/users/users-multiple-servers.ts | 15 +++++---------- server/tests/api/users/users.ts | 5 ++--- 2 files changed, 7 insertions(+), 13 deletions(-) (limited to 'server/tests/api/users') diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts index 03fbfabeb..47056be78 100644 --- a/server/tests/api/users/users-multiple-servers.ts +++ b/server/tests/api/users/users-multiple-servers.ts @@ -12,7 +12,6 @@ import { flushAndRunMultipleServers, getAccountVideos, getMyUserInformation, - getVideoChannelsList, removeUser, ServerInfo, setAccessTokensToServers, @@ -23,7 +22,7 @@ import { userLogin, waitJobs } from '@shared/extra-utils' -import { User, VideoChannel } from '@shared/models' +import { User } from '@shared/models' const expect = chai.expect @@ -199,10 +198,8 @@ describe('Test users with multiple servers', function () { const accountDeleted = body.data.find(a => a.name === 'user1' && a.host === 'localhost:' + servers[0].port) expect(accountDeleted).not.to.be.undefined - const resVideoChannels = await getVideoChannelsList(server.url, 0, 10) - const videoChannelDeleted = resVideoChannels.body.data.find(a => { - return a.displayName === 'Main user1 channel' && a.host === 'localhost:' + servers[0].port - }) as VideoChannel + const { data } = await server.channelsCommand.list() + const videoChannelDeleted = data.find(a => a.displayName === 'Main user1 channel' && a.host === 'localhost:' + servers[0].port) expect(videoChannelDeleted).not.to.be.undefined } @@ -216,10 +213,8 @@ describe('Test users with multiple servers', function () { const accountDeleted = body.data.find(a => a.name === 'user1' && a.host === 'localhost:' + servers[0].port) expect(accountDeleted).to.be.undefined - const resVideoChannels = await getVideoChannelsList(server.url, 0, 10) - const videoChannelDeleted = resVideoChannels.body.data.find(a => { - return a.name === 'Main user1 channel' && a.host === 'localhost:' + servers[0].port - }) as VideoChannel + const { data } = await server.channelsCommand.list() + const videoChannelDeleted = data.find(a => a.name === 'Main user1 channel' && a.host === 'localhost:' + servers[0].port) expect(videoChannelDeleted).to.be.undefined } }) diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 4b9056306..ed670b3c9 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts @@ -18,7 +18,6 @@ import { getUserInformation, getUsersList, getUsersListPaginationAndSort, - getVideoChannel, getVideosList, killallServers, login, @@ -864,9 +863,9 @@ describe('Test users', function () { }) it('Should have created the channel', async function () { - const res = await getVideoChannel(server.url, 'my_user_15_channel') + const { displayName } = await server.channelsCommand.get({ channelName: 'my_user_15_channel' }) - expect(res.body.displayName).to.equal('my channel rocks') + expect(displayName).to.equal('my channel rocks') }) it('Should remove me', async function () { -- cgit v1.2.3