aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/client.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-08 15:54:39 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commite6346d59e63135cf012ed18c102d3b0179ef565f (patch)
treee65259adb50daa6376c9878abeef051d99191328 /server/tests/client.ts
parent72cbfc5695ec5ebdb9721d3648218f63feeaeac5 (diff)
downloadPeerTube-e6346d59e63135cf012ed18c102d3b0179ef565f.tar.gz
PeerTube-e6346d59e63135cf012ed18c102d3b0179ef565f.tar.zst
PeerTube-e6346d59e63135cf012ed18c102d3b0179ef565f.zip
Introduce playlist command
Diffstat (limited to 'server/tests/client.ts')
-rw-r--r--server/tests/client.ts14
1 files changed, 3 insertions, 11 deletions
diff --git a/server/tests/client.ts b/server/tests/client.ts
index 60df878d7..129f1e1c0 100644
--- a/server/tests/client.ts
+++ b/server/tests/client.ts
@@ -6,9 +6,7 @@ import { omit } from 'lodash'
6import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' 6import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
7import { Account, HTMLServerConfig, ServerConfig, VideoPlaylistCreateResult, VideoPlaylistPrivacy } from '@shared/models' 7import { Account, HTMLServerConfig, ServerConfig, VideoPlaylistCreateResult, VideoPlaylistPrivacy } from '@shared/models'
8import { 8import {
9 addVideoInPlaylist,
10 cleanupTests, 9 cleanupTests,
11 createVideoPlaylist,
12 doubleFollow, 10 doubleFollow,
13 flushAndRunMultipleServers, 11 flushAndRunMultipleServers,
14 getVideosList, 12 getVideosList,
@@ -82,23 +80,17 @@ describe('Test a client controllers', function () {
82 80
83 // Playlist 81 // Playlist
84 82
85 const playlistAttrs = { 83 const attributes = {
86 displayName: playlistName, 84 displayName: playlistName,
87 description: playlistDescription, 85 description: playlistDescription,
88 privacy: VideoPlaylistPrivacy.PUBLIC, 86 privacy: VideoPlaylistPrivacy.PUBLIC,
89 videoChannelId: servers[0].videoChannel.id 87 videoChannelId: servers[0].videoChannel.id
90 } 88 }
91 89
92 const resVideoPlaylistRequest = await createVideoPlaylist({ url: servers[0].url, token: servers[0].accessToken, playlistAttrs }) 90 playlist = await servers[0].playlistsCommand.create({ attributes })
93 playlist = resVideoPlaylistRequest.body.videoPlaylist
94 playlistIds = [ playlist.id, playlist.shortUUID, playlist.uuid ] 91 playlistIds = [ playlist.id, playlist.shortUUID, playlist.uuid ]
95 92
96 await addVideoInPlaylist({ 93 await servers[0].playlistsCommand.addElement({ playlistId: playlist.shortUUID, attributes: { videoId: video.id } })
97 url: servers[0].url,
98 token: servers[0].accessToken,
99 playlistId: playlist.shortUUID,
100 elementAttrs: { videoId: video.id }
101 })
102 94
103 // Account 95 // Account
104 96