aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-08 11:23:45 +0200
committerChocobozzz <me@florianbigard.com>2021-04-08 13:38:04 +0200
commit84531547bc0934a2abda586d539f7455b455d488 (patch)
tree128bf5f3a7f57e4e2f343d5da574a4e002163736 /server/tests/api/videos
parenta0eeb45f14bab539f505861cad8f5d42d9ba30cb (diff)
downloadPeerTube-84531547bc0934a2abda586d539f7455b455d488.tar.gz
PeerTube-84531547bc0934a2abda586d539f7455b455d488.tar.zst
PeerTube-84531547bc0934a2abda586d539f7455b455d488.zip
Add size info in db for actor images
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/video-channels.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts
index e50582218..d12d58e75 100644
--- a/server/tests/api/videos/video-channels.ts
+++ b/server/tests/api/videos/video-channels.ts
@@ -2,12 +2,14 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { basename } from 'path'
5import { 6import {
6 cleanupTests, 7 cleanupTests,
7 createUser, 8 createUser,
8 deleteVideoChannelImage, 9 deleteVideoChannelImage,
9 doubleFollow, 10 doubleFollow,
10 flushAndRunMultipleServers, 11 flushAndRunMultipleServers,
12 getActorImage,
11 getVideo, 13 getVideo,
12 getVideoChannel, 14 getVideoChannel,
13 getVideoChannelVideos, 15 getVideoChannelVideos,
@@ -31,6 +33,7 @@ import {
31} from '../../../../shared/extra-utils/index' 33} from '../../../../shared/extra-utils/index'
32import { waitJobs } from '../../../../shared/extra-utils/server/jobs' 34import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
33import { User, Video, VideoChannel, VideoDetails } from '../../../../shared/index' 35import { User, Video, VideoChannel, VideoDetails } from '../../../../shared/index'
36import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants'
34 37
35const expect = chai.expect 38const expect = chai.expect
36 39
@@ -288,6 +291,10 @@ describe('Test video channels', function () {
288 const videoChannel = await findChannel(server, secondVideoChannelId) 291 const videoChannel = await findChannel(server, secondVideoChannelId)
289 292
290 await testImage(server.url, 'avatar-resized', videoChannel.avatar.path, '.png') 293 await testImage(server.url, 'avatar-resized', videoChannel.avatar.path, '.png')
294
295 const row = await getActorImage(server.internalServerNumber, basename(videoChannel.avatar.path))
296 expect(row.height).to.equal(ACTOR_IMAGES_SIZE.AVATARS.height)
297 expect(row.width).to.equal(ACTOR_IMAGES_SIZE.AVATARS.width)
291 } 298 }
292 }) 299 })
293 300
@@ -311,6 +318,10 @@ describe('Test video channels', function () {
311 const videoChannel = res.body 318 const videoChannel = res.body
312 319
313 await testImage(server.url, 'banner-resized', videoChannel.banner.path) 320 await testImage(server.url, 'banner-resized', videoChannel.banner.path)
321
322 const row = await getActorImage(server.internalServerNumber, basename(videoChannel.banner.path))
323 expect(row.height).to.equal(ACTOR_IMAGES_SIZE.BANNERS.height)
324 expect(row.width).to.equal(ACTOR_IMAGES_SIZE.BANNERS.width)
314 } 325 }
315 }) 326 })
316 327