diff options
Diffstat (limited to 'server/tests/api/activitypub/refresher.ts')
-rw-r--r-- | server/tests/api/activitypub/refresher.ts | 22 |
1 files changed, 10 insertions, 12 deletions
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 | ||