diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-07 16:02:46 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | 5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c (patch) | |
tree | 02d056121540652b0867fc2ef56699138afe6271 /server/tests/feeds/feeds.ts | |
parent | 9fff08cf83f34339df7ed4ac770e1dee536adf9d (diff) | |
download | PeerTube-5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c.tar.gz PeerTube-5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c.tar.zst PeerTube-5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c.zip |
Introduce blocklist command
Diffstat (limited to 'server/tests/feeds/feeds.ts')
-rw-r--r-- | server/tests/feeds/feeds.ts | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.ts index 4d29a2e39..17efc666d 100644 --- a/server/tests/feeds/feeds.ts +++ b/server/tests/feeds/feeds.ts | |||
@@ -3,16 +3,10 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import * as xmlParser from 'fast-xml-parser' | 5 | import * as xmlParser from 'fast-xml-parser' |
6 | import { HttpStatusCode } from '@shared/core-utils' | ||
6 | import { | 7 | import { |
7 | addAccountToAccountBlocklist, | 8 | addUserSubscription, |
8 | addAccountToServerBlocklist, | 9 | addVideoCommentThread, |
9 | removeAccountFromServerBlocklist | ||
10 | } from '@shared/extra-utils/users/blocklist' | ||
11 | import { addUserSubscription, listUserSubscriptionVideos } from '@shared/extra-utils/users/user-subscriptions' | ||
12 | import { VideoPrivacy } from '@shared/models' | ||
13 | import { ScopedToken } from '@shared/models/users/user-scoped-token' | ||
14 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
15 | import { | ||
16 | cleanupTests, | 10 | cleanupTests, |
17 | createUser, | 11 | createUser, |
18 | doubleFollow, | 12 | doubleFollow, |
@@ -20,16 +14,17 @@ import { | |||
20 | flushAndRunServer, | 14 | flushAndRunServer, |
21 | getMyUserInformation, | 15 | getMyUserInformation, |
22 | getUserScopedTokens, | 16 | getUserScopedTokens, |
17 | listUserSubscriptionVideos, | ||
23 | renewUserScopedTokens, | 18 | renewUserScopedTokens, |
24 | ServerInfo, | 19 | ServerInfo, |
25 | setAccessTokensToServers, | 20 | setAccessTokensToServers, |
26 | uploadVideo, | 21 | uploadVideo, |
27 | uploadVideoAndGetId, | 22 | uploadVideoAndGetId, |
28 | userLogin | 23 | userLogin, |
29 | } from '../../../shared/extra-utils' | 24 | waitJobs |
30 | import { waitJobs } from '../../../shared/extra-utils/server/jobs' | 25 | } from '@shared/extra-utils' |
31 | import { addVideoCommentThread } from '../../../shared/extra-utils/videos/video-comments' | 26 | import { User, VideoPrivacy } from '@shared/models' |
32 | import { User } from '../../../shared/models/users' | 27 | import { ScopedToken } from '@shared/models/users/user-scoped-token' |
33 | 28 | ||
34 | chai.use(require('chai-xml')) | 29 | chai.use(require('chai-xml')) |
35 | chai.use(require('chai-json-schema')) | 30 | chai.use(require('chai-json-schema')) |
@@ -271,7 +266,7 @@ describe('Test syndication feeds', () => { | |||
271 | 266 | ||
272 | const remoteHandle = 'root@localhost:' + servers[0].port | 267 | const remoteHandle = 'root@localhost:' + servers[0].port |
273 | 268 | ||
274 | await addAccountToServerBlocklist(servers[1].url, servers[1].accessToken, remoteHandle) | 269 | await servers[1].blocklistCommand.addToServerBlocklist({ account: remoteHandle }) |
275 | 270 | ||
276 | { | 271 | { |
277 | const json = await servers[1].feedCommand.getJSON({ feed: 'video-comments', query: { version: 2 } }) | 272 | const json = await servers[1].feedCommand.getJSON({ feed: 'video-comments', query: { version: 2 } }) |
@@ -279,7 +274,7 @@ describe('Test syndication feeds', () => { | |||
279 | expect(jsonObj.items.length).to.be.equal(0) | 274 | expect(jsonObj.items.length).to.be.equal(0) |
280 | } | 275 | } |
281 | 276 | ||
282 | await removeAccountFromServerBlocklist(servers[1].url, servers[1].accessToken, remoteHandle) | 277 | await servers[1].blocklistCommand.removeFromServerBlocklist({ account: remoteHandle }) |
283 | 278 | ||
284 | { | 279 | { |
285 | const videoUUID = (await uploadVideoAndGetId({ server: servers[1], videoName: 'server 2' })).uuid | 280 | const videoUUID = (await uploadVideoAndGetId({ server: servers[1], videoName: 'server 2' })).uuid |
@@ -292,7 +287,7 @@ describe('Test syndication feeds', () => { | |||
292 | expect(jsonObj.items.length).to.be.equal(3) | 287 | expect(jsonObj.items.length).to.be.equal(3) |
293 | } | 288 | } |
294 | 289 | ||
295 | await addAccountToAccountBlocklist(servers[1].url, servers[1].accessToken, remoteHandle) | 290 | await servers[1].blocklistCommand.addToMyBlocklist({ account: remoteHandle }) |
296 | 291 | ||
297 | { | 292 | { |
298 | const json = await servers[1].feedCommand.getJSON({ feed: 'video-comments', query: { version: 4 } }) | 293 | const json = await servers[1].feedCommand.getJSON({ feed: 'video-comments', query: { version: 4 } }) |