diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-23 10:30:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 09:41:54 +0200 |
commit | 240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e (patch) | |
tree | 99879ddce7d4b2970c263cb045c5057ed07354d4 /server/tests | |
parent | 83e6519ba4ee752dc3148a16c69effbfccb13e6b (diff) | |
download | PeerTube-240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e.tar.gz PeerTube-240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e.tar.zst PeerTube-240085d0056fd97ac3c7fa8fa4ce9bc32afc4d6e.zip |
Fix tests
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/check-params/video-imports.ts | 2 | ||||
-rw-r--r-- | server/tests/api/users/users-multiple-servers.ts | 7 | ||||
-rw-r--r-- | server/tests/api/videos/video-nsfw.ts | 6 | ||||
-rw-r--r-- | server/tests/cli/update-host.ts | 4 |
4 files changed, 10 insertions, 9 deletions
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 () { | |||
28 | let userAccessToken = '' | 28 | let userAccessToken = '' |
29 | let accountName: string | 29 | let accountName: string |
30 | let channelId: number | 30 | let channelId: number |
31 | let channelUUID: string | ||
32 | 31 | ||
33 | // --------------------------------------------------------------- | 32 | // --------------------------------------------------------------- |
34 | 33 | ||
@@ -49,7 +48,6 @@ describe('Test video imports API validator', function () { | |||
49 | { | 48 | { |
50 | const res = await getMyUserInformation(server.url, server.accessToken) | 49 | const res = await getMyUserInformation(server.url, server.accessToken) |
51 | channelId = res.body.videoChannels[ 0 ].id | 50 | channelId = res.body.videoChannels[ 0 ].id |
52 | channelUUID = res.body.videoChannels[ 0 ].uuid | ||
53 | accountName = res.body.account.name + '@' + res.body.account.host | 51 | accountName = res.body.account.name + '@' + res.body.account.host |
54 | } | 52 | } |
55 | }) | 53 | }) |
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 () { | |||
27 | let servers: ServerInfo[] = [] | 27 | let servers: ServerInfo[] = [] |
28 | let user: User | 28 | let user: User |
29 | let userAccountName: string | 29 | let userAccountName: string |
30 | let userAccountUUID: string | ||
30 | let userVideoChannelUUID: string | 31 | let userVideoChannelUUID: string |
31 | let userId: number | 32 | let userId: number |
32 | let videoUUID: string | 33 | let videoUUID: string |
@@ -62,7 +63,9 @@ describe('Test users with multiple servers', function () { | |||
62 | 63 | ||
63 | { | 64 | { |
64 | const res = await getMyUserInformation(servers[0].url, userAccessToken) | 65 | const res = await getMyUserInformation(servers[0].url, userAccessToken) |
65 | userAccountName = res.body.account.name + '@' + res.body.account.host | 66 | const account: Account = res.body.account |
67 | userAccountName = account.name + '@' + account.host | ||
68 | userAccountUUID = account.uuid | ||
66 | } | 69 | } |
67 | 70 | ||
68 | { | 71 | { |
@@ -196,7 +199,7 @@ describe('Test users with multiple servers', function () { | |||
196 | 199 | ||
197 | it('Should not have actor files', async () => { | 200 | it('Should not have actor files', async () => { |
198 | for (const server of servers) { | 201 | for (const server of servers) { |
199 | await checkActorFilesWereRemoved(userAccountName, server.serverNumber) | 202 | await checkActorFilesWereRemoved(userAccountUUID, server.serverNumber) |
200 | await checkActorFilesWereRemoved(userVideoChannelUUID, server.serverNumber) | 203 | await checkActorFilesWereRemoved(userVideoChannelUUID, server.serverNumber) |
201 | } | 204 | } |
202 | }) | 205 | }) |
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 () { | |||
34 | return getMyUserInformation(server.url, server.accessToken) | 34 | return getMyUserInformation(server.url, server.accessToken) |
35 | .then(res => { | 35 | .then(res => { |
36 | const user: User = res.body | 36 | const user: User = res.body |
37 | const videoChannelUUID = user.videoChannels[0].uuid | 37 | const videoChannelName = user.videoChannels[0].name |
38 | const accountName = user.account.name + '@' + user.account.host | 38 | const accountName = user.account.name + '@' + user.account.host |
39 | 39 | ||
40 | if (token) { | 40 | if (token) { |
@@ -42,7 +42,7 @@ describe('Test video NSFW policy', function () { | |||
42 | getVideosListWithToken(server.url, token, query), | 42 | getVideosListWithToken(server.url, token, query), |
43 | searchVideoWithToken(server.url, 'n', token, query), | 43 | searchVideoWithToken(server.url, 'n', token, query), |
44 | getAccountVideos(server.url, token, accountName, 0, 5, undefined, query), | 44 | getAccountVideos(server.url, token, accountName, 0, 5, undefined, query), |
45 | getVideoChannelVideos(server.url, token, videoChannelUUID, 0, 5, undefined, query) | 45 | getVideoChannelVideos(server.url, token, videoChannelName, 0, 5, undefined, query) |
46 | ]) | 46 | ]) |
47 | } | 47 | } |
48 | 48 | ||
@@ -50,7 +50,7 @@ describe('Test video NSFW policy', function () { | |||
50 | getVideosList(server.url), | 50 | getVideosList(server.url), |
51 | searchVideo(server.url, 'n'), | 51 | searchVideo(server.url, 'n'), |
52 | getAccountVideos(server.url, undefined, accountName, 0, 5), | 52 | getAccountVideos(server.url, undefined, accountName, 0, 5), |
53 | getVideoChannelVideos(server.url, undefined, videoChannelUUID, 0, 5) | 53 | getVideoChannelVideos(server.url, undefined, videoChannelName, 0, 5) |
54 | ]) | 54 | ]) |
55 | }) | 55 | }) |
56 | } | 56 | } |
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 () { | |||
94 | expect(res.body.total).to.equal(3) | 94 | expect(res.body.total).to.equal(3) |
95 | 95 | ||
96 | for (const channel of res.body.data) { | 96 | for (const channel of res.body.data) { |
97 | const { body } = await makeActivityPubGetRequest(server.url, '/video-channels/' + channel.uuid) | 97 | const { body } = await makeActivityPubGetRequest(server.url, '/video-channels/' + channel.name) |
98 | 98 | ||
99 | expect(body.id).to.equal('http://localhost:9002/video-channels/' + channel.uuid) | 99 | expect(body.id).to.equal('http://localhost:9002/video-channels/' + channel.name) |
100 | } | 100 | } |
101 | }) | 101 | }) |
102 | 102 | ||