aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-26 10:55:40 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commit418d092afa81e2c8fe8ac6838fc4b5eb0af6a782 (patch)
tree5e9bc5604fd5d66a006cfebb7acdbdd5486e5d1e /server/tests/api/videos
parentb427febb4d5cebf03b815bca2c59af6e82491569 (diff)
downloadPeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.gz
PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.zst
PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.zip
Playlist server API
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/video-playlists.ts161
1 files changed, 161 insertions, 0 deletions
diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts
new file mode 100644
index 000000000..cb23239da
--- /dev/null
+++ b/server/tests/api/videos/video-playlists.ts
@@ -0,0 +1,161 @@
1/* tslint:disable:no-unused-expression */
2
3import * as chai from 'chai'
4import 'mocha'
5import { join } from 'path'
6import * as request from 'supertest'
7import { VideoPrivacy } from '../../../../shared/models/videos'
8import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
9import {
10 addVideoChannel,
11 checkTmpIsEmpty,
12 checkVideoFilesWereRemoved,
13 completeVideoCheck,
14 createUser,
15 dateIsValid,
16 doubleFollow,
17 flushAndRunMultipleServers,
18 flushTests,
19 getLocalVideos,
20 getVideo,
21 getVideoChannelsList,
22 getVideosList,
23 killallServers,
24 rateVideo,
25 removeVideo,
26 ServerInfo,
27 setAccessTokensToServers,
28 testImage,
29 updateVideo,
30 uploadVideo,
31 userLogin,
32 viewVideo,
33 wait,
34 webtorrentAdd
35} from '../../../../shared/utils'
36import {
37 addVideoCommentReply,
38 addVideoCommentThread,
39 deleteVideoComment,
40 getVideoCommentThreads,
41 getVideoThreadComments
42} from '../../../../shared/utils/videos/video-comments'
43import { waitJobs } from '../../../../shared/utils/server/jobs'
44
45const expect = chai.expect
46
47describe('Test video playlists', function () {
48 let servers: ServerInfo[] = []
49
50 before(async function () {
51 this.timeout(120000)
52
53 servers = await flushAndRunMultipleServers(3)
54
55 // Get the access tokens
56 await setAccessTokensToServers(servers)
57
58 // Server 1 and server 2 follow each other
59 await doubleFollow(servers[0], servers[1])
60 // Server 1 and server 3 follow each other
61 await doubleFollow(servers[0], servers[2])
62 })
63
64 it('Should create a playlist on server 1 and have the playlist on server 2 and 3', async function () {
65
66 })
67
68 it('Should create a playlist on server 2 and have the playlist on server 1 but not on server 3', async function () {
69 // create 2 playlists (with videos and no videos)
70 // With thumbnail and no thumbnail
71 })
72
73 it('Should have the playlist on server 3 after a new follow', async function () {
74 // Server 2 and server 3 follow each other
75 await doubleFollow(servers[1], servers[2])
76 })
77
78 it('Should create some playlists and list them correctly', async function () {
79 // create 3 playlists with some videos in it
80 // check pagination
81 // check sort
82 // check empty
83 })
84
85 it('Should list video channel playlists', async function () {
86 // check pagination
87 // check sort
88 // check empty
89 })
90
91 it('Should list account playlists', async function () {
92 // check pagination
93 // check sort
94 // check empty
95 })
96
97 it('Should get a playlist', async function () {
98 // get empty playlist
99 // get non empty playlist
100 })
101
102 it('Should update a playlist', async function () {
103 // update thumbnail
104
105 // update other details
106 })
107
108 it('Should create a playlist containing different startTimestamp/endTimestamp videos', async function () {
109
110 })
111
112 it('Should correctly list playlist videos', async function () {
113 // empty
114 // some filters?
115 })
116
117 it('Should reorder the playlist', async function () {
118 // reorder 1 element
119 // reorder 3 elements
120 // reorder at the beginning
121 // reorder at the end
122 // reorder before/after
123 })
124
125 it('Should update startTimestamp/endTimestamp of some elements', async function () {
126
127 })
128
129 it('Should delete some elements', async function () {
130
131 })
132
133 it('Should delete the playlist on server 1 and delete on server 2 and 3', async function () {
134
135 })
136
137 it('Should have deleted the thumbnail on server 1, 2 and 3', async function () {
138
139 })
140
141 it('Should unfollow servers 1 and 2 and hide their playlists', async function () {
142
143 })
144
145 it('Should delete a channel and remove the associated playlist', async function () {
146
147 })
148
149 it('Should delete an account and delete its playlists', async function () {
150
151 })
152
153 after(async function () {
154 killallServers(servers)
155
156 // Keep the logs if the test failed
157 if (this['ok']) {
158 await flushTests()
159 }
160 })
161})