]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-comments.ts
Merge branch 'release/4.3.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-comments.ts
index 1488ce2b5a32cbedbac9a51231bc85c443ea48dc..348b408e85cc3ac582a8a0c3ffa04dff3bdce3bf 100644 (file)
@@ -1,7 +1,6 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
+import { expect } from 'chai'
 import { dateIsValid, testImage } from '@server/tests/shared'
 import {
   cleanupTests,
@@ -13,8 +12,6 @@ import {
   setDefaultChannelAvatar
 } from '@shared/server-commands'
 
-const expect = chai.expect
-
 describe('Test video comments', function () {
   let server: PeerTubeServer
   let videoId: number
@@ -254,6 +251,22 @@ describe('Test video comments', function () {
       expect(total).to.equal(0)
     })
 
+    it('Should filter instance comments by onLocalVideo', async function () {
+      {
+        const { total, data } = await command.listForAdmin({ onLocalVideo: false })
+
+        expect(data).to.have.lengthOf(0)
+        expect(total).to.equal(0)
+      }
+
+      {
+        const { total, data } = await command.listForAdmin({ onLocalVideo: true })
+
+        expect(data).to.not.have.lengthOf(0)
+        expect(total).to.not.equal(0)
+      }
+    })
+
     it('Should search instance comments by account', async function () {
       const { total, data } = await command.listForAdmin({ searchAccount: 'user' })