From 240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 23 Aug 2018 10:30:53 +0200 Subject: Fix tests --- server/tests/api/check-params/video-imports.ts | 2 -- server/tests/api/users/users-multiple-servers.ts | 7 +++++-- server/tests/api/videos/video-nsfw.ts | 6 +++--- server/tests/cli/update-host.ts | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) (limited to 'server/tests') diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts index 5975985a1..44645b0e2 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts @@ -28,7 +28,6 @@ describe('Test video imports API validator', function () { let userAccessToken = '' let accountName: string let channelId: number - let channelUUID: string // --------------------------------------------------------------- @@ -49,7 +48,6 @@ describe('Test video imports API validator', function () { { const res = await getMyUserInformation(server.url, server.accessToken) channelId = res.body.videoChannels[ 0 ].id - channelUUID = res.body.videoChannels[ 0 ].uuid accountName = res.body.account.name + '@' + res.body.account.host } }) diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts index 575e04546..b67072851 100644 --- a/server/tests/api/users/users-multiple-servers.ts +++ b/server/tests/api/users/users-multiple-servers.ts @@ -27,6 +27,7 @@ describe('Test users with multiple servers', function () { let servers: ServerInfo[] = [] let user: User let userAccountName: string + let userAccountUUID: string let userVideoChannelUUID: string let userId: number let videoUUID: string @@ -62,7 +63,9 @@ describe('Test users with multiple servers', function () { { const res = await getMyUserInformation(servers[0].url, userAccessToken) - userAccountName = res.body.account.name + '@' + res.body.account.host + const account: Account = res.body.account + userAccountName = account.name + '@' + account.host + userAccountUUID = account.uuid } { @@ -196,7 +199,7 @@ describe('Test users with multiple servers', function () { it('Should not have actor files', async () => { for (const server of servers) { - await checkActorFilesWereRemoved(userAccountName, server.serverNumber) + await checkActorFilesWereRemoved(userAccountUUID, server.serverNumber) await checkActorFilesWereRemoved(userVideoChannelUUID, server.serverNumber) } }) diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts index 370e69d2a..891148b07 100644 --- a/server/tests/api/videos/video-nsfw.ts +++ b/server/tests/api/videos/video-nsfw.ts @@ -34,7 +34,7 @@ describe('Test video NSFW policy', function () { return getMyUserInformation(server.url, server.accessToken) .then(res => { const user: User = res.body - const videoChannelUUID = user.videoChannels[0].uuid + const videoChannelName = user.videoChannels[0].name const accountName = user.account.name + '@' + user.account.host if (token) { @@ -42,7 +42,7 @@ describe('Test video NSFW policy', function () { getVideosListWithToken(server.url, token, query), searchVideoWithToken(server.url, 'n', token, query), getAccountVideos(server.url, token, accountName, 0, 5, undefined, query), - getVideoChannelVideos(server.url, token, videoChannelUUID, 0, 5, undefined, query) + getVideoChannelVideos(server.url, token, videoChannelName, 0, 5, undefined, query) ]) } @@ -50,7 +50,7 @@ describe('Test video NSFW policy', function () { getVideosList(server.url), searchVideo(server.url, 'n'), getAccountVideos(server.url, undefined, accountName, 0, 5), - getVideoChannelVideos(server.url, undefined, videoChannelUUID, 0, 5) + getVideoChannelVideos(server.url, undefined, videoChannelName, 0, 5) ]) }) } diff --git a/server/tests/cli/update-host.ts b/server/tests/cli/update-host.ts index 7f54c0e70..b89e72ab7 100644 --- a/server/tests/cli/update-host.ts +++ b/server/tests/cli/update-host.ts @@ -94,9 +94,9 @@ describe('Test update host scripts', function () { expect(res.body.total).to.equal(3) for (const channel of res.body.data) { - const { body } = await makeActivityPubGetRequest(server.url, '/video-channels/' + channel.uuid) + const { body } = await makeActivityPubGetRequest(server.url, '/video-channels/' + channel.name) - expect(body.id).to.equal('http://localhost:9002/video-channels/' + channel.uuid) + expect(body.id).to.equal('http://localhost:9002/video-channels/' + channel.name) } }) -- cgit v1.2.3