diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-06 14:12:12 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-05-06 14:12:12 +0200 |
commit | 1df8a4d79a491d2ad5bdd9329f37e52cba21238c (patch) | |
tree | 4d678958352f1d6044c2ef9fe052f66d323a01b0 /server/tests/feeds | |
parent | f375bb3db401e42b4317545a7e40dcfda692604d (diff) | |
download | PeerTube-1df8a4d79a491d2ad5bdd9329f37e52cba21238c.tar.gz PeerTube-1df8a4d79a491d2ad5bdd9329f37e52cba21238c.tar.zst PeerTube-1df8a4d79a491d2ad5bdd9329f37e52cba21238c.zip |
Fix comments feed with musted accounts
Diffstat (limited to 'server/tests/feeds')
-rw-r--r-- | server/tests/feeds/feeds.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.ts index d978123cf..7fac921a3 100644 --- a/server/tests/feeds/feeds.ts +++ b/server/tests/feeds/feeds.ts | |||
@@ -20,6 +20,7 @@ import { addVideoCommentThread } from '../../../shared/extra-utils/videos/video- | |||
20 | import { waitJobs } from '../../../shared/extra-utils/server/jobs' | 20 | import { waitJobs } from '../../../shared/extra-utils/server/jobs' |
21 | import { User } from '../../../shared/models/users' | 21 | import { User } from '../../../shared/models/users' |
22 | import { VideoPrivacy } from '@shared/models' | 22 | import { VideoPrivacy } from '@shared/models' |
23 | import { addAccountToServerBlocklist } from '@shared/extra-utils/users/blocklist' | ||
23 | 24 | ||
24 | chai.use(require('chai-xml')) | 25 | chai.use(require('chai-xml')) |
25 | chai.use(require('chai-json-schema')) | 26 | chai.use(require('chai-json-schema')) |
@@ -216,6 +217,17 @@ describe('Test syndication feeds', () => { | |||
216 | expect(jsonObj.items[1].html_content).to.equal('super comment 1') | 217 | expect(jsonObj.items[1].html_content).to.equal('super comment 1') |
217 | } | 218 | } |
218 | }) | 219 | }) |
220 | |||
221 | it('Should not list comments from muted accounts or instances', async function () { | ||
222 | await addAccountToServerBlocklist(servers[1].url, servers[1].accessToken, 'root@localhost:' + servers[0].port) | ||
223 | |||
224 | { | ||
225 | const json = await getJSONfeed(servers[1].url, 'video-comments', { version: 2 }) | ||
226 | const jsonObj = JSON.parse(json.text) | ||
227 | expect(jsonObj.items.length).to.be.equal(0) | ||
228 | } | ||
229 | |||
230 | }) | ||
219 | }) | 231 | }) |
220 | 232 | ||
221 | after(async function () { | 233 | after(async function () { |