diff options
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r-- | server/tests/api/videos/resumable-upload.ts | 4 | ||||
-rw-r--r-- | server/tests/api/videos/video-channels.ts | 18 |
2 files changed, 18 insertions, 4 deletions
diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.ts index af9221c43..4fc3317df 100644 --- a/server/tests/api/videos/resumable-upload.ts +++ b/server/tests/api/videos/resumable-upload.ts | |||
@@ -8,6 +8,7 @@ import { HttpStatusCode } from '@shared/core-utils' | |||
8 | import { | 8 | import { |
9 | buildAbsoluteFixturePath, | 9 | buildAbsoluteFixturePath, |
10 | buildServerDirectory, | 10 | buildServerDirectory, |
11 | cleanupTests, | ||
11 | flushAndRunServer, | 12 | flushAndRunServer, |
12 | getMyUserInformation, | 13 | getMyUserInformation, |
13 | prepareResumableUpload, | 14 | prepareResumableUpload, |
@@ -184,4 +185,7 @@ describe('Test resumable upload', function () { | |||
184 | }) | 185 | }) |
185 | }) | 186 | }) |
186 | 187 | ||
188 | after(async function () { | ||
189 | await cleanupTests([ server ]) | ||
190 | }) | ||
187 | }) | 191 | }) |
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts index 7e7ad028c..865098777 100644 --- a/server/tests/api/videos/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts | |||
@@ -15,6 +15,7 @@ import { | |||
15 | getVideoChannel, | 15 | getVideoChannel, |
16 | getVideoChannelVideos, | 16 | getVideoChannelVideos, |
17 | setDefaultVideoChannel, | 17 | setDefaultVideoChannel, |
18 | testFileExistsOrNot, | ||
18 | testImage, | 19 | testImage, |
19 | updateVideo, | 20 | updateVideo, |
20 | updateVideoChannelImage, | 21 | updateVideoChannelImage, |
@@ -53,6 +54,9 @@ describe('Test video channels', function () { | |||
53 | let videoUUID: string | 54 | let videoUUID: string |
54 | let accountName: string | 55 | let accountName: string |
55 | 56 | ||
57 | const avatarPaths: { [ port: number ]: string } = {} | ||
58 | const bannerPaths: { [ port: number ]: string } = {} | ||
59 | |||
56 | before(async function () { | 60 | before(async function () { |
57 | this.timeout(60000) | 61 | this.timeout(60000) |
58 | 62 | ||
@@ -287,9 +291,11 @@ describe('Test video channels', function () { | |||
287 | for (const server of servers) { | 291 | for (const server of servers) { |
288 | const videoChannel = await findChannel(server, secondVideoChannelId) | 292 | const videoChannel = await findChannel(server, secondVideoChannelId) |
289 | 293 | ||
290 | await testImage(server.url, 'avatar-resized', videoChannel.avatar.path, '.png') | 294 | avatarPaths[server.port] = videoChannel.avatar.path |
295 | await testImage(server.url, 'avatar-resized', avatarPaths[server.port], '.png') | ||
296 | await testFileExistsOrNot(server, 'avatars', basename(avatarPaths[server.port]), true) | ||
291 | 297 | ||
292 | const row = await getActorImage(server.internalServerNumber, basename(videoChannel.avatar.path)) | 298 | const row = await getActorImage(server.internalServerNumber, basename(avatarPaths[server.port])) |
293 | expect(row.height).to.equal(ACTOR_IMAGES_SIZE.AVATARS.height) | 299 | expect(row.height).to.equal(ACTOR_IMAGES_SIZE.AVATARS.height) |
294 | expect(row.width).to.equal(ACTOR_IMAGES_SIZE.AVATARS.width) | 300 | expect(row.width).to.equal(ACTOR_IMAGES_SIZE.AVATARS.width) |
295 | } | 301 | } |
@@ -314,9 +320,11 @@ describe('Test video channels', function () { | |||
314 | const res = await getVideoChannel(server.url, 'second_video_channel@' + servers[0].host) | 320 | const res = await getVideoChannel(server.url, 'second_video_channel@' + servers[0].host) |
315 | const videoChannel = res.body | 321 | const videoChannel = res.body |
316 | 322 | ||
317 | await testImage(server.url, 'banner-resized', videoChannel.banner.path) | 323 | bannerPaths[server.port] = videoChannel.banner.path |
324 | await testImage(server.url, 'banner-resized', bannerPaths[server.port]) | ||
325 | await testFileExistsOrNot(server, 'avatars', basename(bannerPaths[server.port]), true) | ||
318 | 326 | ||
319 | const row = await getActorImage(server.internalServerNumber, basename(videoChannel.banner.path)) | 327 | const row = await getActorImage(server.internalServerNumber, basename(bannerPaths[server.port])) |
320 | expect(row.height).to.equal(ACTOR_IMAGES_SIZE.BANNERS.height) | 328 | expect(row.height).to.equal(ACTOR_IMAGES_SIZE.BANNERS.height) |
321 | expect(row.width).to.equal(ACTOR_IMAGES_SIZE.BANNERS.width) | 329 | expect(row.width).to.equal(ACTOR_IMAGES_SIZE.BANNERS.width) |
322 | } | 330 | } |
@@ -336,6 +344,7 @@ describe('Test video channels', function () { | |||
336 | 344 | ||
337 | for (const server of servers) { | 345 | for (const server of servers) { |
338 | const videoChannel = await findChannel(server, secondVideoChannelId) | 346 | const videoChannel = await findChannel(server, secondVideoChannelId) |
347 | await testFileExistsOrNot(server, 'avatars', basename(avatarPaths[server.port]), false) | ||
339 | 348 | ||
340 | expect(videoChannel.avatar).to.be.null | 349 | expect(videoChannel.avatar).to.be.null |
341 | } | 350 | } |
@@ -355,6 +364,7 @@ describe('Test video channels', function () { | |||
355 | 364 | ||
356 | for (const server of servers) { | 365 | for (const server of servers) { |
357 | const videoChannel = await findChannel(server, secondVideoChannelId) | 366 | const videoChannel = await findChannel(server, secondVideoChannelId) |
367 | await testFileExistsOrNot(server, 'avatars', basename(bannerPaths[server.port]), false) | ||
358 | 368 | ||
359 | expect(videoChannel.banner).to.be.null | 369 | expect(videoChannel.banner).to.be.null |
360 | } | 370 | } |