]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-comments.ts
Fix live constraints tests
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-comments.ts
index 61ee54540963426fd27c92d3ec5298fe9caa9b57..1488ce2b5a32cbedbac9a51231bc85c443ea48dc 100644 (file)
@@ -2,15 +2,16 @@
 
 import 'mocha'
 import * as chai from 'chai'
+import { dateIsValid, testImage } from '@server/tests/shared'
 import {
   cleanupTests,
   CommentsCommand,
   createSingleServer,
-  dateIsValid,
   PeerTubeServer,
   setAccessTokensToServers,
-  testImage
-} from '@shared/extra-utils'
+  setDefaultAccountAvatar,
+  setDefaultChannelAvatar
+} from '@shared/server-commands'
 
 const expect = chai.expect
 
@@ -36,7 +37,8 @@ describe('Test video comments', function () {
     videoUUID = uuid
     videoId = id
 
-    await server.users.updateMyAvatar({ fixture: 'avatar.png' })
+    await setDefaultChannelAvatar(server)
+    await setDefaultAccountAvatar(server)
 
     userAccessTokenServer1 = await server.users.generateUserAndToken('user1')
 
@@ -88,7 +90,9 @@ describe('Test video comments', function () {
       expect(comment.account.name).to.equal('root')
       expect(comment.account.host).to.equal('localhost:' + server.port)
 
-      await testImage(server.url, 'avatar-resized', comment.account.avatar.path, '.png')
+      for (const avatar of comment.account.avatars) {
+        await testImage(server.url, `avatar-resized-${avatar.width}x${avatar.width}`, avatar.path, '.png')
+      }
 
       expect(comment.totalReplies).to.equal(0)
       expect(comment.totalRepliesFromVideoAuthor).to.equal(0)