diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-21 15:51:30 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-21 15:51:30 +0200 |
commit | a24bd1ed41b43790bab6ba789580bb4e85f07d85 (patch) | |
tree | a54b0f6c921ba83a6e909cd0ced325b2d4b8863c /server/tests/api/activitypub/client.ts | |
parent | 5f26f13b3c16ac5ae0a3b0a7142d84a9528cf565 (diff) | |
parent | c63830f15403ac4e750829f27d8bbbdc9a59282c (diff) | |
download | PeerTube-a24bd1ed41b43790bab6ba789580bb4e85f07d85.tar.gz PeerTube-a24bd1ed41b43790bab6ba789580bb4e85f07d85.tar.zst PeerTube-a24bd1ed41b43790bab6ba789580bb4e85f07d85.zip |
Merge branch 'next' into develop
Diffstat (limited to 'server/tests/api/activitypub/client.ts')
-rw-r--r-- | server/tests/api/activitypub/client.ts | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index be94e219c..c3e4b7f74 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts | |||
@@ -2,24 +2,21 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { VideoPlaylistPrivacy } from '@shared/models' | ||
6 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
7 | import { | 5 | import { |
8 | cleanupTests, | 6 | cleanupTests, |
9 | createVideoPlaylist, | 7 | createMultipleServers, |
10 | doubleFollow, | 8 | doubleFollow, |
11 | flushAndRunMultipleServers, | ||
12 | makeActivityPubGetRequest, | 9 | makeActivityPubGetRequest, |
13 | ServerInfo, | 10 | PeerTubeServer, |
14 | setAccessTokensToServers, | 11 | setAccessTokensToServers, |
15 | setDefaultVideoChannel, | 12 | setDefaultVideoChannel |
16 | uploadVideoAndGetId | 13 | } from '@shared/extra-utils' |
17 | } from '../../../../shared/extra-utils' | 14 | import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' |
18 | 15 | ||
19 | const expect = chai.expect | 16 | const expect = chai.expect |
20 | 17 | ||
21 | describe('Test activitypub', function () { | 18 | describe('Test activitypub', function () { |
22 | let servers: ServerInfo[] = [] | 19 | let servers: PeerTubeServer[] = [] |
23 | let video: { id: number, uuid: string, shortUUID: string } | 20 | let video: { id: number, uuid: string, shortUUID: string } |
24 | let playlist: { id: number, uuid: string, shortUUID: string } | 21 | let playlist: { id: number, uuid: string, shortUUID: string } |
25 | 22 | ||
@@ -64,19 +61,18 @@ describe('Test activitypub', function () { | |||
64 | before(async function () { | 61 | before(async function () { |
65 | this.timeout(30000) | 62 | this.timeout(30000) |
66 | 63 | ||
67 | servers = await flushAndRunMultipleServers(2) | 64 | servers = await createMultipleServers(2) |
68 | 65 | ||
69 | await setAccessTokensToServers(servers) | 66 | await setAccessTokensToServers(servers) |
70 | await setDefaultVideoChannel(servers) | 67 | await setDefaultVideoChannel(servers) |
71 | 68 | ||
72 | { | 69 | { |
73 | video = await uploadVideoAndGetId({ server: servers[0], videoName: 'video' }) | 70 | video = await servers[0].videos.quickUpload({ name: 'video' }) |
74 | } | 71 | } |
75 | 72 | ||
76 | { | 73 | { |
77 | const playlistAttrs = { displayName: 'playlist', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[0].videoChannel.id } | 74 | const attributes = { displayName: 'playlist', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[0].store.channel.id } |
78 | const resCreate = await createVideoPlaylist({ url: servers[0].url, token: servers[0].accessToken, playlistAttrs }) | 75 | playlist = await servers[0].playlists.create({ attributes }) |
79 | playlist = resCreate.body.videoPlaylist | ||
80 | } | 76 | } |
81 | 77 | ||
82 | await doubleFollow(servers[0], servers[1]) | 78 | await doubleFollow(servers[0], servers[1]) |