diff options
Diffstat (limited to 'server/tests/api/videos/video-playlist-thumbnails.ts')
-rw-r--r-- | server/tests/api/videos/video-playlist-thumbnails.ts | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/server/tests/api/videos/video-playlist-thumbnails.ts b/server/tests/api/videos/video-playlist-thumbnails.ts index 73ab02c17..a93a0b7de 100644 --- a/server/tests/api/videos/video-playlist-thumbnails.ts +++ b/server/tests/api/videos/video-playlist-thumbnails.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import 'mocha' | 4 | import 'mocha' |
@@ -8,14 +8,15 @@ import { | |||
8 | createVideoPlaylist, | 8 | createVideoPlaylist, |
9 | doubleFollow, | 9 | doubleFollow, |
10 | flushAndRunMultipleServers, | 10 | flushAndRunMultipleServers, |
11 | getVideoPlaylistsList, removeVideoFromPlaylist, | 11 | getVideoPlaylistsList, |
12 | removeVideoFromPlaylist, | ||
13 | reorderVideosPlaylist, | ||
12 | ServerInfo, | 14 | ServerInfo, |
13 | setAccessTokensToServers, | 15 | setAccessTokensToServers, |
14 | setDefaultVideoChannel, | 16 | setDefaultVideoChannel, |
15 | testImage, | 17 | testImage, |
16 | uploadVideoAndGetId, | 18 | uploadVideoAndGetId, |
17 | waitJobs, | 19 | waitJobs |
18 | reorderVideosPlaylist | ||
19 | } from '../../../../shared/extra-utils' | 20 | } from '../../../../shared/extra-utils' |
20 | import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' | 21 | import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' |
21 | 22 | ||
@@ -69,19 +70,19 @@ describe('Playlist thumbnail', function () { | |||
69 | this.timeout(30000) | 70 | this.timeout(30000) |
70 | 71 | ||
71 | const res = await createVideoPlaylist({ | 72 | const res = await createVideoPlaylist({ |
72 | url: servers[ 1 ].url, | 73 | url: servers[1].url, |
73 | token: servers[ 1 ].accessToken, | 74 | token: servers[1].accessToken, |
74 | playlistAttrs: { | 75 | playlistAttrs: { |
75 | displayName: 'playlist without thumbnail', | 76 | displayName: 'playlist without thumbnail', |
76 | privacy: VideoPlaylistPrivacy.PUBLIC, | 77 | privacy: VideoPlaylistPrivacy.PUBLIC, |
77 | videoChannelId: servers[ 1 ].videoChannel.id | 78 | videoChannelId: servers[1].videoChannel.id |
78 | } | 79 | } |
79 | }) | 80 | }) |
80 | playlistWithoutThumbnail = res.body.videoPlaylist.id | 81 | playlistWithoutThumbnail = res.body.videoPlaylist.id |
81 | 82 | ||
82 | const res2 = await addVideoInPlaylist({ | 83 | const res2 = await addVideoInPlaylist({ |
83 | url: servers[ 1 ].url, | 84 | url: servers[1].url, |
84 | token: servers[ 1 ].accessToken, | 85 | token: servers[1].accessToken, |
85 | playlistId: playlistWithoutThumbnail, | 86 | playlistId: playlistWithoutThumbnail, |
86 | elementAttrs: { videoId: video1 } | 87 | elementAttrs: { videoId: video1 } |
87 | }) | 88 | }) |
@@ -99,20 +100,20 @@ describe('Playlist thumbnail', function () { | |||
99 | this.timeout(30000) | 100 | this.timeout(30000) |
100 | 101 | ||
101 | const res = await createVideoPlaylist({ | 102 | const res = await createVideoPlaylist({ |
102 | url: servers[ 1 ].url, | 103 | url: servers[1].url, |
103 | token: servers[ 1 ].accessToken, | 104 | token: servers[1].accessToken, |
104 | playlistAttrs: { | 105 | playlistAttrs: { |
105 | displayName: 'playlist with thumbnail', | 106 | displayName: 'playlist with thumbnail', |
106 | privacy: VideoPlaylistPrivacy.PUBLIC, | 107 | privacy: VideoPlaylistPrivacy.PUBLIC, |
107 | videoChannelId: servers[ 1 ].videoChannel.id, | 108 | videoChannelId: servers[1].videoChannel.id, |
108 | thumbnailfile: 'thumbnail.jpg' | 109 | thumbnailfile: 'thumbnail.jpg' |
109 | } | 110 | } |
110 | }) | 111 | }) |
111 | playlistWithThumbnail = res.body.videoPlaylist.id | 112 | playlistWithThumbnail = res.body.videoPlaylist.id |
112 | 113 | ||
113 | const res2 = await addVideoInPlaylist({ | 114 | const res2 = await addVideoInPlaylist({ |
114 | url: servers[ 1 ].url, | 115 | url: servers[1].url, |
115 | token: servers[ 1 ].accessToken, | 116 | token: servers[1].accessToken, |
116 | playlistId: playlistWithThumbnail, | 117 | playlistId: playlistWithThumbnail, |
117 | elementAttrs: { videoId: video1 } | 118 | elementAttrs: { videoId: video1 } |
118 | }) | 119 | }) |
@@ -130,8 +131,8 @@ describe('Playlist thumbnail', function () { | |||
130 | this.timeout(30000) | 131 | this.timeout(30000) |
131 | 132 | ||
132 | const res = await addVideoInPlaylist({ | 133 | const res = await addVideoInPlaylist({ |
133 | url: servers[ 1 ].url, | 134 | url: servers[1].url, |
134 | token: servers[ 1 ].accessToken, | 135 | token: servers[1].accessToken, |
135 | playlistId: playlistWithoutThumbnail, | 136 | playlistId: playlistWithoutThumbnail, |
136 | elementAttrs: { videoId: video2 } | 137 | elementAttrs: { videoId: video2 } |
137 | }) | 138 | }) |
@@ -159,8 +160,8 @@ describe('Playlist thumbnail', function () { | |||
159 | this.timeout(30000) | 160 | this.timeout(30000) |
160 | 161 | ||
161 | const res = await addVideoInPlaylist({ | 162 | const res = await addVideoInPlaylist({ |
162 | url: servers[ 1 ].url, | 163 | url: servers[1].url, |
163 | token: servers[ 1 ].accessToken, | 164 | token: servers[1].accessToken, |
164 | playlistId: playlistWithThumbnail, | 165 | playlistId: playlistWithThumbnail, |
165 | elementAttrs: { videoId: video2 } | 166 | elementAttrs: { videoId: video2 } |
166 | }) | 167 | }) |
@@ -188,8 +189,8 @@ describe('Playlist thumbnail', function () { | |||
188 | this.timeout(30000) | 189 | this.timeout(30000) |
189 | 190 | ||
190 | await removeVideoFromPlaylist({ | 191 | await removeVideoFromPlaylist({ |
191 | url: servers[ 1 ].url, | 192 | url: servers[1].url, |
192 | token: servers[ 1 ].accessToken, | 193 | token: servers[1].accessToken, |
193 | playlistId: playlistWithoutThumbnail, | 194 | playlistId: playlistWithoutThumbnail, |
194 | playlistElementId: withoutThumbnailE1 | 195 | playlistElementId: withoutThumbnailE1 |
195 | }) | 196 | }) |
@@ -206,8 +207,8 @@ describe('Playlist thumbnail', function () { | |||
206 | this.timeout(30000) | 207 | this.timeout(30000) |
207 | 208 | ||
208 | await removeVideoFromPlaylist({ | 209 | await removeVideoFromPlaylist({ |
209 | url: servers[ 1 ].url, | 210 | url: servers[1].url, |
210 | token: servers[ 1 ].accessToken, | 211 | token: servers[1].accessToken, |
211 | playlistId: playlistWithThumbnail, | 212 | playlistId: playlistWithThumbnail, |
212 | playlistElementId: withThumbnailE1 | 213 | playlistElementId: withThumbnailE1 |
213 | }) | 214 | }) |
@@ -224,8 +225,8 @@ describe('Playlist thumbnail', function () { | |||
224 | this.timeout(30000) | 225 | this.timeout(30000) |
225 | 226 | ||
226 | await removeVideoFromPlaylist({ | 227 | await removeVideoFromPlaylist({ |
227 | url: servers[ 1 ].url, | 228 | url: servers[1].url, |
228 | token: servers[ 1 ].accessToken, | 229 | token: servers[1].accessToken, |
229 | playlistId: playlistWithoutThumbnail, | 230 | playlistId: playlistWithoutThumbnail, |
230 | playlistElementId: withoutThumbnailE2 | 231 | playlistElementId: withoutThumbnailE2 |
231 | }) | 232 | }) |
@@ -242,8 +243,8 @@ describe('Playlist thumbnail', function () { | |||
242 | this.timeout(30000) | 243 | this.timeout(30000) |
243 | 244 | ||
244 | await removeVideoFromPlaylist({ | 245 | await removeVideoFromPlaylist({ |
245 | url: servers[ 1 ].url, | 246 | url: servers[1].url, |
246 | token: servers[ 1 ].accessToken, | 247 | token: servers[1].accessToken, |
247 | playlistId: playlistWithThumbnail, | 248 | playlistId: playlistWithThumbnail, |
248 | playlistElementId: withThumbnailE2 | 249 | playlistElementId: withThumbnailE2 |
249 | }) | 250 | }) |