]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/moderation/abuses.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / moderation / abuses.ts
index c258414ce3c39145a7fd87dbffbfc901ef533af4..568fbefcf06e88c5b608218e0b9ffd0b81c8dfb3 100644 (file)
@@ -2,6 +2,7 @@
 
 import 'mocha'
 import * as chai from 'chai'
+import { AbuseMessage, AbusePredefinedReasonsString, AbuseState, AdminAbuse, UserAbuse } from '@shared/models'
 import {
   AbusesCommand,
   cleanupTests,
@@ -9,9 +10,10 @@ import {
   doubleFollow,
   PeerTubeServer,
   setAccessTokensToServers,
+  setDefaultAccountAvatar,
+  setDefaultChannelAvatar,
   waitJobs
-} from '@shared/extra-utils'
-import { AbuseMessage, AbusePredefinedReasonsString, AbuseState, AdminAbuse, UserAbuse } from '@shared/models'
+} from '@shared/server-commands'
 
 const expect = chai.expect
 
@@ -27,8 +29,9 @@ describe('Test abuses', function () {
     // Run servers
     servers = await createMultipleServers(2)
 
-    // Get the access tokens
     await setAccessTokensToServers(servers)
+    await setDefaultChannelAvatar(servers)
+    await setDefaultAccountAvatar(servers)
 
     // Server 1 and server 2 follow each other
     await doubleFollow(servers[0], servers[1])
@@ -165,7 +168,7 @@ describe('Test abuses', function () {
         expect(abuse2.reporterAccount.name).to.equal('root')
         expect(abuse2.reporterAccount.host).to.equal(servers[0].host)
 
-        expect(abuse2.video.id).to.equal(servers[1].store.videoCreated.id)
+        expect(abuse2.video.uuid).to.equal(servers[1].store.videoCreated.uuid)
 
         expect(abuse2.comment).to.be.null
 
@@ -468,7 +471,7 @@ describe('Test abuses', function () {
     })
 
     it('Should have 2 comment abuses on server 1 and 1 on server 2', async function () {
-      const commentServer2 = await getComment(servers[0], servers[1].store.videoCreated.id)
+      const commentServer2 = await getComment(servers[0], servers[1].store.videoCreated.shortUUID)
 
       {
         const body = await commands[0].getAdminList({ filter: 'comment' })
@@ -527,7 +530,7 @@ describe('Test abuses', function () {
     it('Should keep the comment abuse when deleting the comment', async function () {
       this.timeout(10000)
 
-      const commentServer2 = await getComment(servers[0], servers[1].store.videoCreated.id)
+      const commentServer2 = await getComment(servers[0], servers[1].store.videoCreated.uuid)
 
       await servers[0].comments.delete({ videoId: servers[1].store.videoCreated.uuid, commentId: commentServer2.id })