diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-07 09:16:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | c3d29f694bf8c910f917be655626d0f80871124f (patch) | |
tree | c90dfdc1245c8a9aca49e9ea9c71ed8e6b9dd35f /server/tests/api/users/user-subscriptions.ts | |
parent | 883a9019085ff9013079d6b1539b86f2f519175a (diff) | |
download | PeerTube-c3d29f694bf8c910f917be655626d0f80871124f.tar.gz PeerTube-c3d29f694bf8c910f917be655626d0f80871124f.tar.zst PeerTube-c3d29f694bf8c910f917be655626d0f80871124f.zip |
Introduce follows command
Diffstat (limited to 'server/tests/api/users/user-subscriptions.ts')
-rw-r--r-- | server/tests/api/users/user-subscriptions.ts | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/server/tests/api/users/user-subscriptions.ts b/server/tests/api/users/user-subscriptions.ts index 60676a37b..7e365d797 100644 --- a/server/tests/api/users/user-subscriptions.ts +++ b/server/tests/api/users/user-subscriptions.ts | |||
@@ -1,30 +1,27 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | ||
4 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | ||
5 | import { | 5 | import { |
6 | addUserSubscription, | ||
7 | areSubscriptionsExist, | ||
6 | cleanupTests, | 8 | cleanupTests, |
7 | createUser, | 9 | createUser, |
8 | doubleFollow, | 10 | doubleFollow, |
9 | flushAndRunMultipleServers, | 11 | flushAndRunMultipleServers, |
10 | follow, | ||
11 | getVideosList, | ||
12 | unfollow, | ||
13 | updateVideo, | ||
14 | userLogin | ||
15 | } from '../../../../shared/extra-utils' | ||
16 | import { ServerInfo, uploadVideo } from '../../../../shared/extra-utils/index' | ||
17 | import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' | ||
18 | import { Video, VideoChannel } from '../../../../shared/models/videos' | ||
19 | import { waitJobs } from '../../../../shared/extra-utils/server/jobs' | ||
20 | import { | ||
21 | addUserSubscription, | ||
22 | areSubscriptionsExist, | ||
23 | getUserSubscription, | 12 | getUserSubscription, |
13 | getVideosList, | ||
24 | listUserSubscriptions, | 14 | listUserSubscriptions, |
25 | listUserSubscriptionVideos, | 15 | listUserSubscriptionVideos, |
26 | removeUserSubscription | 16 | removeUserSubscription, |
27 | } from '../../../../shared/extra-utils/users/user-subscriptions' | 17 | ServerInfo, |
18 | setAccessTokensToServers, | ||
19 | updateVideo, | ||
20 | uploadVideo, | ||
21 | userLogin, | ||
22 | waitJobs | ||
23 | } from '@shared/extra-utils' | ||
24 | import { Video, VideoChannel } from '@shared/models' | ||
28 | 25 | ||
29 | const expect = chai.expect | 26 | const expect = chai.expect |
30 | 27 | ||
@@ -250,7 +247,7 @@ describe('Test users subscriptions', function () { | |||
250 | it('Should have server 1 follow server 3 and display server 3 videos', async function () { | 247 | it('Should have server 1 follow server 3 and display server 3 videos', async function () { |
251 | this.timeout(60000) | 248 | this.timeout(60000) |
252 | 249 | ||
253 | await follow(servers[0].url, [ servers[2].url ], servers[0].accessToken) | 250 | await servers[0].followsCommand.follow({ targets: [ servers[2].url ] }) |
254 | 251 | ||
255 | await waitJobs(servers) | 252 | await waitJobs(servers) |
256 | 253 | ||
@@ -268,7 +265,7 @@ describe('Test users subscriptions', function () { | |||
268 | it('Should remove follow server 1 -> server 3 and hide server 3 videos', async function () { | 265 | it('Should remove follow server 1 -> server 3 and hide server 3 videos', async function () { |
269 | this.timeout(60000) | 266 | this.timeout(60000) |
270 | 267 | ||
271 | await unfollow(servers[0].url, servers[0].accessToken, servers[2]) | 268 | await servers[0].followsCommand.unfollow({ target: servers[2] }) |
272 | 269 | ||
273 | await waitJobs(servers) | 270 | await waitJobs(servers) |
274 | 271 | ||