diff options
Diffstat (limited to 'server/tests/api/activitypub')
-rw-r--r-- | server/tests/api/activitypub/client.ts | 6 | ||||
-rw-r--r-- | server/tests/api/activitypub/refresher.ts | 22 |
2 files changed, 12 insertions, 16 deletions
diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index be94e219c..e8536a214 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts | |||
@@ -6,7 +6,6 @@ import { VideoPlaylistPrivacy } from '@shared/models' | |||
6 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 6 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' |
7 | import { | 7 | import { |
8 | cleanupTests, | 8 | cleanupTests, |
9 | createVideoPlaylist, | ||
10 | doubleFollow, | 9 | doubleFollow, |
11 | flushAndRunMultipleServers, | 10 | flushAndRunMultipleServers, |
12 | makeActivityPubGetRequest, | 11 | makeActivityPubGetRequest, |
@@ -74,9 +73,8 @@ describe('Test activitypub', function () { | |||
74 | } | 73 | } |
75 | 74 | ||
76 | { | 75 | { |
77 | const playlistAttrs = { displayName: 'playlist', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[0].videoChannel.id } | 76 | const attributes = { displayName: 'playlist', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[0].videoChannel.id } |
78 | const resCreate = await createVideoPlaylist({ url: servers[0].url, token: servers[0].accessToken, playlistAttrs }) | 77 | playlist = await servers[0].playlistsCommand.create({ attributes }) |
79 | playlist = resCreate.body.videoPlaylist | ||
80 | } | 78 | } |
81 | 79 | ||
82 | await doubleFollow(servers[0], servers[1]) | 80 | await doubleFollow(servers[0], servers[1]) |
diff --git a/server/tests/api/activitypub/refresher.ts b/server/tests/api/activitypub/refresher.ts index 0d5452ea4..f295dfab7 100644 --- a/server/tests/api/activitypub/refresher.ts +++ b/server/tests/api/activitypub/refresher.ts | |||
@@ -5,12 +5,10 @@ import { HttpStatusCode } from '@shared/core-utils' | |||
5 | import { | 5 | import { |
6 | cleanupTests, | 6 | cleanupTests, |
7 | closeAllSequelize, | 7 | closeAllSequelize, |
8 | createVideoPlaylist, | ||
9 | doubleFollow, | 8 | doubleFollow, |
10 | flushAndRunMultipleServers, | 9 | flushAndRunMultipleServers, |
11 | generateUserAccessToken, | 10 | generateUserAccessToken, |
12 | getVideo, | 11 | getVideo, |
13 | getVideoPlaylist, | ||
14 | killallServers, | 12 | killallServers, |
15 | reRunServer, | 13 | reRunServer, |
16 | ServerInfo, | 14 | ServerInfo, |
@@ -58,15 +56,15 @@ describe('Test AP refresher', function () { | |||
58 | } | 56 | } |
59 | 57 | ||
60 | { | 58 | { |
61 | const playlistAttrs = { displayName: 'playlist1', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[1].videoChannel.id } | 59 | const attributes = { displayName: 'playlist1', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[1].videoChannel.id } |
62 | const res = await createVideoPlaylist({ url: servers[1].url, token: servers[1].accessToken, playlistAttrs }) | 60 | const created = await servers[1].playlistsCommand.create({ attributes }) |
63 | playlistUUID1 = res.body.videoPlaylist.uuid | 61 | playlistUUID1 = created.uuid |
64 | } | 62 | } |
65 | 63 | ||
66 | { | 64 | { |
67 | const playlistAttrs = { displayName: 'playlist2', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[1].videoChannel.id } | 65 | const attributes = { displayName: 'playlist2', privacy: VideoPlaylistPrivacy.PUBLIC, videoChannelId: servers[1].videoChannel.id } |
68 | const res = await createVideoPlaylist({ url: servers[1].url, token: servers[1].accessToken, playlistAttrs }) | 66 | const created = await servers[1].playlistsCommand.create({ attributes }) |
69 | playlistUUID2 = res.body.videoPlaylist.uuid | 67 | playlistUUID2 = created.uuid |
70 | } | 68 | } |
71 | 69 | ||
72 | await doubleFollow(servers[0], servers[1]) | 70 | await doubleFollow(servers[0], servers[1]) |
@@ -144,13 +142,13 @@ describe('Test AP refresher', function () { | |||
144 | // Change UUID so the remote server returns a 404 | 142 | // Change UUID so the remote server returns a 404 |
145 | await setPlaylistField(servers[1].internalServerNumber, playlistUUID2, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b178e') | 143 | await setPlaylistField(servers[1].internalServerNumber, playlistUUID2, 'uuid', '304afe4f-39f9-4d49-8ed7-ac57b86b178e') |
146 | 144 | ||
147 | await getVideoPlaylist(servers[0].url, playlistUUID1) | 145 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID1 }) |
148 | await getVideoPlaylist(servers[0].url, playlistUUID2) | 146 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID2 }) |
149 | 147 | ||
150 | await waitJobs(servers) | 148 | await waitJobs(servers) |
151 | 149 | ||
152 | await getVideoPlaylist(servers[0].url, playlistUUID1, HttpStatusCode.OK_200) | 150 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID1, expectedStatus: HttpStatusCode.OK_200 }) |
153 | await getVideoPlaylist(servers[0].url, playlistUUID2, HttpStatusCode.NOT_FOUND_404) | 151 | await servers[0].playlistsCommand.get({ playlistId: playlistUUID2, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) |
154 | }) | 152 | }) |
155 | }) | 153 | }) |
156 | 154 | ||