aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-03-14 15:29:23 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commit397d78fb3e55aeeedf3591d7be9d7a30849d9e82 (patch)
tree8ddfd01fa8ab3a1a12ce400d675ab55eb4d8e39e /server/tests/api/videos
parent978c9d497b36e52196eb7e755406571e5d57cbc7 (diff)
downloadPeerTube-397d78fb3e55aeeedf3591d7be9d7a30849d9e82.tar.gz
PeerTube-397d78fb3e55aeeedf3591d7be9d7a30849d9e82.tar.zst
PeerTube-397d78fb3e55aeeedf3591d7be9d7a30849d9e82.zip
Fix unit tests
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/video-playlists.ts18
1 files changed, 13 insertions, 5 deletions
diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts
index 358a064ff..fc2662808 100644
--- a/server/tests/api/videos/video-playlists.ts
+++ b/server/tests/api/videos/video-playlists.ts
@@ -14,7 +14,7 @@ import {
14 flushAndRunMultipleServers, 14 flushAndRunMultipleServers,
15 flushTests, 15 flushTests,
16 getAccountPlaylistsList, 16 getAccountPlaylistsList,
17 getAccountPlaylistsListWithToken, 17 getAccountPlaylistsListWithToken, getMyUserInformation,
18 getPlaylistVideos, 18 getPlaylistVideos,
19 getVideoChannelPlaylistsList, 19 getVideoChannelPlaylistsList,
20 getVideoPlaylist, 20 getVideoPlaylist,
@@ -42,6 +42,7 @@ import { VideoPlaylist } from '../../../../shared/models/videos/playlist/video-p
42import { Video } from '../../../../shared/models/videos' 42import { Video } from '../../../../shared/models/videos'
43import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model' 43import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model'
44import { VideoExistInPlaylist } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model' 44import { VideoExistInPlaylist } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model'
45import { User } from '../../../../shared/models/users'
45 46
46const expect = chai.expect 47const expect = chai.expect
47 48
@@ -195,7 +196,8 @@ describe('Test video playlists', function () {
195 token: servers[1].accessToken, 196 token: servers[1].accessToken,
196 playlistAttrs: { 197 playlistAttrs: {
197 displayName: 'playlist 2', 198 displayName: 'playlist 2',
198 privacy: VideoPlaylistPrivacy.PUBLIC 199 privacy: VideoPlaylistPrivacy.PUBLIC,
200 videoChannelId: servers[1].videoChannel.id
199 } 201 }
200 }) 202 })
201 playlistServer2Id1 = res.body.videoPlaylist.id 203 playlistServer2Id1 = res.body.videoPlaylist.id
@@ -208,7 +210,8 @@ describe('Test video playlists', function () {
208 playlistAttrs: { 210 playlistAttrs: {
209 displayName: 'playlist 3', 211 displayName: 'playlist 3',
210 privacy: VideoPlaylistPrivacy.PUBLIC, 212 privacy: VideoPlaylistPrivacy.PUBLIC,
211 thumbnailfile: 'thumbnail.jpg' 213 thumbnailfile: 'thumbnail.jpg',
214 videoChannelId: servers[1].videoChannel.id
212 } 215 }
213 }) 216 })
214 217
@@ -422,7 +425,8 @@ describe('Test video playlists', function () {
422 token: servers[ 0 ].accessToken, 425 token: servers[ 0 ].accessToken,
423 playlistAttrs: { 426 playlistAttrs: {
424 displayName: 'playlist 4', 427 displayName: 'playlist 4',
425 privacy: VideoPlaylistPrivacy.PUBLIC 428 privacy: VideoPlaylistPrivacy.PUBLIC,
429 videoChannelId: servers[0].videoChannel.id
426 } 430 }
427 }) 431 })
428 432
@@ -816,12 +820,16 @@ describe('Test video playlists', function () {
816 const userId = res.body.user.id 820 const userId = res.body.user.id
817 const userAccessToken = await userLogin(servers[0], user) 821 const userAccessToken = await userLogin(servers[0], user)
818 822
823 const resChannel = await getMyUserInformation(servers[0].url, userAccessToken)
824 const userChannel = (resChannel.body as User).videoChannels[0]
825
819 await createVideoPlaylist({ 826 await createVideoPlaylist({
820 url: servers[0].url, 827 url: servers[0].url,
821 token: userAccessToken, 828 token: userAccessToken,
822 playlistAttrs: { 829 playlistAttrs: {
823 displayName: 'playlist to be deleted', 830 displayName: 'playlist to be deleted',
824 privacy: VideoPlaylistPrivacy.PUBLIC 831 privacy: VideoPlaylistPrivacy.PUBLIC,
832 videoChannelId: userChannel.id
825 } 833 }
826 }) 834 })
827 835