aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-playlists.ts
blob: cb23239da9027330368448c6a3d5dbf1cb73e226 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/* tslint:disable:no-unused-expression */

import * as chai from 'chai'
import 'mocha'
import { join } from 'path'
import * as request from 'supertest'
import { VideoPrivacy } from '../../../../shared/models/videos'
import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
import {
  addVideoChannel,
  checkTmpIsEmpty,
  checkVideoFilesWereRemoved,
  completeVideoCheck,
  createUser,
  dateIsValid,
  doubleFollow,
  flushAndRunMultipleServers,
  flushTests,
  getLocalVideos,
  getVideo,
  getVideoChannelsList,
  getVideosList,
  killallServers,
  rateVideo,
  removeVideo,
  ServerInfo,
  setAccessTokensToServers,
  testImage,
  updateVideo,
  uploadVideo,
  userLogin,
  viewVideo,
  wait,
  webtorrentAdd
} from '../../../../shared/utils'
import {
  addVideoCommentReply,
  addVideoCommentThread,
  deleteVideoComment,
  getVideoCommentThreads,
  getVideoThreadComments
} from '../../../../shared/utils/videos/video-comments'
import { waitJobs } from '../../../../shared/utils/server/jobs'

const expect = chai.expect

describe('Test video playlists', function () {
  let servers: ServerInfo[] = []

  before(async function () {
    this.timeout(120000)

    servers = await flushAndRunMultipleServers(3)

    // Get the access tokens
    await setAccessTokensToServers(servers)

    // Server 1 and server 2 follow each other
    await doubleFollow(servers[0], servers[1])
    // Server 1 and server 3 follow each other
    await doubleFollow(servers[0], servers[2])
  })

  it('Should create a playlist on server 1 and have the playlist on server 2 and 3', async function () {

  })

  it('Should create a playlist on server 2 and have the playlist on server 1 but not on server 3', async function () {
    // create 2 playlists (with videos and no videos)
    // With thumbnail and no thumbnail
  })

  it('Should have the playlist on server 3 after a new follow', async function () {
    // Server 2 and server 3 follow each other
    await doubleFollow(servers[1], servers[2])
  })

  it('Should create some playlists and list them correctly', async function () {
    // create 3 playlists with some videos in it
    // check pagination
    // check sort
    // check empty
  })

  it('Should list video channel playlists', async function () {
    // check pagination
    // check sort
    // check empty
  })

  it('Should list account playlists', async function () {
    // check pagination
    // check sort
    // check empty
  })

  it('Should get a playlist', async function () {
    // get empty playlist
    // get non empty playlist
  })

  it('Should update a playlist', async function () {
    // update thumbnail

    // update other details
  })

  it('Should create a playlist containing different startTimestamp/endTimestamp videos', async function () {

  })

  it('Should correctly list playlist videos', async function () {
    // empty
    // some filters?
  })

  it('Should reorder the playlist', async function () {
    // reorder 1 element
    // reorder 3 elements
    // reorder at the beginning
    // reorder at the end
    // reorder before/after
  })

  it('Should update startTimestamp/endTimestamp of some elements', async function () {

  })

  it('Should delete some elements', async function () {

  })

  it('Should delete the playlist on server 1 and delete on server 2 and 3', async function () {

  })

  it('Should have deleted the thumbnail on server 1, 2 and 3', async function () {

  })

  it('Should unfollow servers 1 and 2 and hide their playlists', async function () {

  })

  it('Should delete a channel and remove the associated playlist', async function () {

  })

  it('Should delete an account and delete its playlists', async function () {

  })

  after(async function () {
    killallServers(servers)

    // Keep the logs if the test failed
    if (this['ok']) {
      await flushTests()
    }
  })
})