aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/videos')
-rw-r--r--server/tests/api/videos/audio-only.ts2
-rw-r--r--server/tests/api/videos/multiple-servers.ts5
-rw-r--r--server/tests/api/videos/resumable-upload.ts3
-rw-r--r--server/tests/api/videos/video-captions.ts2
-rw-r--r--server/tests/api/videos/video-change-ownership.ts5
-rw-r--r--server/tests/api/videos/video-channels.ts2
-rw-r--r--server/tests/api/videos/video-comments.ts2
-rw-r--r--server/tests/api/videos/video-description.ts2
-rw-r--r--server/tests/api/videos/video-hls.ts5
-rw-r--r--server/tests/api/videos/video-nsfw.ts9
-rw-r--r--server/tests/api/videos/video-playlist-thumbnails.ts2
-rw-r--r--server/tests/api/videos/video-playlists.ts6
-rw-r--r--server/tests/api/videos/video-privacy.ts7
-rw-r--r--server/tests/api/videos/video-schedule-update.ts2
-rw-r--r--server/tests/api/videos/video-transcoder.ts5
-rw-r--r--server/tests/api/videos/videos-filter.ts5
-rw-r--r--server/tests/api/videos/videos-history.ts3
-rw-r--r--server/tests/api/videos/videos-views-cleaner.ts2
18 files changed, 31 insertions, 38 deletions
diff --git a/server/tests/api/videos/audio-only.ts b/server/tests/api/videos/audio-only.ts
index b9bf96650..15c3ae6d6 100644
--- a/server/tests/api/videos/audio-only.ts
+++ b/server/tests/api/videos/audio-only.ts
@@ -4,7 +4,7 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { join } from 'path' 5import { join } from 'path'
6import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils' 6import { getAudioStream, getVideoStreamSize } from '@server/helpers/ffprobe-utils'
7import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 7import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
8 8
9const expect = chai.expect 9const expect = chai.expect
10 10
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index edf2773cd..d916abb09 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -3,16 +3,15 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import * as request from 'supertest' 5import * as request from 'supertest'
6import { HttpStatusCode } from '@shared/models'
7import { 6import {
8 buildAbsoluteFixturePath, 7 buildAbsoluteFixturePath,
9 checkTmpIsEmpty, 8 checkTmpIsEmpty,
10 checkVideoFilesWereRemoved, 9 checkVideoFilesWereRemoved,
11 cleanupTests, 10 cleanupTests,
12 completeVideoCheck, 11 completeVideoCheck,
12 createMultipleServers,
13 dateIsValid, 13 dateIsValid,
14 doubleFollow, 14 doubleFollow,
15 createMultipleServers,
16 PeerTubeServer, 15 PeerTubeServer,
17 setAccessTokensToServers, 16 setAccessTokensToServers,
18 testImage, 17 testImage,
@@ -20,7 +19,7 @@ import {
20 waitJobs, 19 waitJobs,
21 webtorrentAdd 20 webtorrentAdd
22} from '@shared/extra-utils' 21} from '@shared/extra-utils'
23import { VideoCommentThreadTree, VideoPrivacy } from '@shared/models' 22import { HttpStatusCode, VideoCommentThreadTree, VideoPrivacy } from '@shared/models'
24 23
25const expect = chai.expect 24const expect = chai.expect
26 25
diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.ts
index 0e62972c2..13e47c85e 100644
--- a/server/tests/api/videos/resumable-upload.ts
+++ b/server/tests/api/videos/resumable-upload.ts
@@ -4,7 +4,6 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { pathExists, readdir, stat } from 'fs-extra' 5import { pathExists, readdir, stat } from 'fs-extra'
6import { join } from 'path' 6import { join } from 'path'
7import { HttpStatusCode } from '@shared/models'
8import { 7import {
9 buildAbsoluteFixturePath, 8 buildAbsoluteFixturePath,
10 cleanupTests, 9 cleanupTests,
@@ -13,7 +12,7 @@ import {
13 setAccessTokensToServers, 12 setAccessTokensToServers,
14 setDefaultVideoChannel 13 setDefaultVideoChannel
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
16import { VideoPrivacy } from '@shared/models' 15import { HttpStatusCode, VideoPrivacy } from '@shared/models'
17 16
18const expect = chai.expect 17const expect = chai.expect
19 18
diff --git a/server/tests/api/videos/video-captions.ts b/server/tests/api/videos/video-captions.ts
index 6caba6aa6..e3d46e619 100644
--- a/server/tests/api/videos/video-captions.ts
+++ b/server/tests/api/videos/video-captions.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { 5import {
6 checkVideoFilesWereRemoved, 6 checkVideoFilesWereRemoved,
7 cleanupTests, 7 cleanupTests,
8 doubleFollow,
9 createMultipleServers, 8 createMultipleServers,
9 doubleFollow,
10 PeerTubeServer, 10 PeerTubeServer,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 testCaptionFile, 12 testCaptionFile,
diff --git a/server/tests/api/videos/video-change-ownership.ts b/server/tests/api/videos/video-change-ownership.ts
index 792550101..6ae6d3004 100644
--- a/server/tests/api/videos/video-change-ownership.ts
+++ b/server/tests/api/videos/video-change-ownership.ts
@@ -2,19 +2,18 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 ChangeOwnershipCommand, 6 ChangeOwnershipCommand,
8 cleanupTests, 7 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 8 createMultipleServers,
11 createSingleServer, 9 createSingleServer,
10 doubleFollow,
12 PeerTubeServer, 11 PeerTubeServer,
13 setAccessTokensToServers, 12 setAccessTokensToServers,
14 setDefaultVideoChannel, 13 setDefaultVideoChannel,
15 waitJobs 14 waitJobs
16} from '@shared/extra-utils' 15} from '@shared/extra-utils'
17import { VideoPrivacy } from '@shared/models' 16import { HttpStatusCode, VideoPrivacy } from '@shared/models'
18 17
19const expect = chai.expect 18const expect = chai.expect
20 19
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts
index eeaec5ad2..c25754eb6 100644
--- a/server/tests/api/videos/video-channels.ts
+++ b/server/tests/api/videos/video-channels.ts
@@ -6,8 +6,8 @@ import { basename } from 'path'
6import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants' 6import { ACTOR_IMAGES_SIZE } from '@server/initializers/constants'
7import { 7import {
8 cleanupTests, 8 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 9 createMultipleServers,
10 doubleFollow,
11 PeerTubeServer, 11 PeerTubeServer,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 setDefaultVideoChannel, 13 setDefaultVideoChannel,
diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts
index 9709e0628..61ee54540 100644
--- a/server/tests/api/videos/video-comments.ts
+++ b/server/tests/api/videos/video-comments.ts
@@ -5,8 +5,8 @@ import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 CommentsCommand, 7 CommentsCommand,
8 dateIsValid,
9 createSingleServer, 8 createSingleServer,
9 dateIsValid,
10 PeerTubeServer, 10 PeerTubeServer,
11 setAccessTokensToServers, 11 setAccessTokensToServers,
12 testImage 12 testImage
diff --git a/server/tests/api/videos/video-description.ts b/server/tests/api/videos/video-description.ts
index ce45eac80..d22b4ed96 100644
--- a/server/tests/api/videos/video-description.ts
+++ b/server/tests/api/videos/video-description.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { cleanupTests, doubleFollow, createMultipleServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 5import { cleanupTests, createMultipleServers, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
6 6
7const expect = chai.expect 7const expect = chai.expect
8 8
diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts
index df030110b..7845f7334 100644
--- a/server/tests/api/videos/video-hls.ts
+++ b/server/tests/api/videos/video-hls.ts
@@ -3,22 +3,21 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { join } from 'path' 5import { join } from 'path'
6import { HttpStatusCode } from '@shared/models'
7import { 6import {
8 checkDirectoryIsEmpty, 7 checkDirectoryIsEmpty,
9 checkResolutionsInMasterPlaylist, 8 checkResolutionsInMasterPlaylist,
10 checkSegmentHash, 9 checkSegmentHash,
11 checkTmpIsEmpty, 10 checkTmpIsEmpty,
12 cleanupTests, 11 cleanupTests,
13 doubleFollow,
14 createMultipleServers, 12 createMultipleServers,
13 doubleFollow,
15 makeRawRequest, 14 makeRawRequest,
16 PeerTubeServer, 15 PeerTubeServer,
17 setAccessTokensToServers, 16 setAccessTokensToServers,
18 waitJobs, 17 waitJobs,
19 webtorrentAdd 18 webtorrentAdd
20} from '@shared/extra-utils' 19} from '@shared/extra-utils'
21import { VideoStreamingPlaylistType } from '@shared/models' 20import { HttpStatusCode, VideoStreamingPlaylistType } from '@shared/models'
22import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' 21import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants'
23 22
24const expect = chai.expect 23const expect = chai.expect
diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts
index 0a9e5ce3f..b5d183d62 100644
--- a/server/tests/api/videos/video-nsfw.ts
+++ b/server/tests/api/videos/video-nsfw.ts
@@ -30,8 +30,8 @@ describe('Test video NSFW policy', function () {
30 promises = [ 30 promises = [
31 server.search.advancedVideoSearch({ token, search: { search: 'n', sort: '-publishedAt', ...query } }), 31 server.search.advancedVideoSearch({ token, search: { search: 'n', sort: '-publishedAt', ...query } }),
32 server.videos.listWithToken({ token, ...query }), 32 server.videos.listWithToken({ token, ...query }),
33 server.videos.listByAccount({ token, handle: channelName, ...query }), 33 server.videos.listByAccount({ token, handle: accountName, ...query }),
34 server.videos.listByChannel({ token, handle: accountName, ...query }) 34 server.videos.listByChannel({ token, handle: channelName, ...query })
35 ] 35 ]
36 36
37 // Overviews do not support video filters 37 // Overviews do not support video filters
@@ -47,8 +47,8 @@ describe('Test video NSFW policy', function () {
47 promises = [ 47 promises = [
48 server.search.searchVideos({ search: 'n', sort: '-publishedAt' }), 48 server.search.searchVideos({ search: 'n', sort: '-publishedAt' }),
49 server.videos.list(), 49 server.videos.list(),
50 server.videos.listByAccount({ handle: channelName }), 50 server.videos.listByAccount({ token: null, handle: accountName }),
51 server.videos.listByChannel({ handle: accountName }) 51 server.videos.listByChannel({ token: null, handle: channelName })
52 ] 52 ]
53 53
54 // Overviews do not support video filters 54 // Overviews do not support video filters
@@ -82,6 +82,7 @@ describe('Test video NSFW policy', function () {
82 }) 82 })
83 83
84 describe('Instance default NSFW policy', function () { 84 describe('Instance default NSFW policy', function () {
85
85 it('Should display NSFW videos with display default NSFW policy', async function () { 86 it('Should display NSFW videos with display default NSFW policy', async function () {
86 const serverConfig = await server.config.getConfig() 87 const serverConfig = await server.config.getConfig()
87 expect(serverConfig.instance.defaultNSFWPolicy).to.equal('display') 88 expect(serverConfig.instance.defaultNSFWPolicy).to.equal('display')
diff --git a/server/tests/api/videos/video-playlist-thumbnails.ts b/server/tests/api/videos/video-playlist-thumbnails.ts
index 9a682c12b..f0b2ca169 100644
--- a/server/tests/api/videos/video-playlist-thumbnails.ts
+++ b/server/tests/api/videos/video-playlist-thumbnails.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 PeerTubeServer, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 setDefaultVideoChannel, 11 setDefaultVideoChannel,
diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts
index 9a28a421a..f42aee2ff 100644
--- a/server/tests/api/videos/video-playlists.ts
+++ b/server/tests/api/videos/video-playlists.ts
@@ -2,14 +2,13 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 checkPlaylistFilesWereRemoved, 6 checkPlaylistFilesWereRemoved,
8 cleanupTests, 7 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 8 createMultipleServers,
11 PlaylistsCommand, 9 doubleFollow,
12 PeerTubeServer, 10 PeerTubeServer,
11 PlaylistsCommand,
13 setAccessTokensToServers, 12 setAccessTokensToServers,
14 setDefaultVideoChannel, 13 setDefaultVideoChannel,
15 testImage, 14 testImage,
@@ -17,6 +16,7 @@ import {
17 waitJobs 16 waitJobs
18} from '@shared/extra-utils' 17} from '@shared/extra-utils'
19import { 18import {
19 HttpStatusCode,
20 VideoPlaylist, 20 VideoPlaylist,
21 VideoPlaylistCreateResult, 21 VideoPlaylistCreateResult,
22 VideoPlaylistElementType, 22 VideoPlaylistElementType,
diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts
index 06011082d..b51b3bcdd 100644
--- a/server/tests/api/videos/video-privacy.ts
+++ b/server/tests/api/videos/video-privacy.ts
@@ -2,9 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models' 5import { cleanupTests, createSingleServer, doubleFollow, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils'
6import { cleanupTests, doubleFollow, createSingleServer, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' 6import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
7import { VideoCreateResult, VideoPrivacy } from '@shared/models'
8 7
9const expect = chai.expect 8const expect = chai.expect
10 9
@@ -162,7 +161,7 @@ describe('Test video privacy', function () {
162 }) 161 })
163 162
164 it('Should not be able to get this unlisted video using its id', async function () { 163 it('Should not be able to get this unlisted video using its id', async function () {
165 await servers[1].videos.get({ id: unlistedVideo.id, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) 164 await servers[1].videos.get({ id: unlistedVideo.id, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
166 }) 165 })
167 166
168 it('Should be able to get this unlisted video using its uuid/shortUUID', async function () { 167 it('Should be able to get this unlisted video using its uuid/shortUUID', async function () {
diff --git a/server/tests/api/videos/video-schedule-update.ts b/server/tests/api/videos/video-schedule-update.ts
index 22b5cf1c2..3f7738784 100644
--- a/server/tests/api/videos/video-schedule-update.ts
+++ b/server/tests/api/videos/video-schedule-update.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 PeerTubeServer, 9 PeerTubeServer,
10 setAccessTokensToServers, 10 setAccessTokensToServers,
11 wait, 11 wait,
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index 7510472e3..e4892bb24 100644
--- a/server/tests/api/videos/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -4,12 +4,11 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { omit } from 'lodash' 5import { omit } from 'lodash'
6import { join } from 'path' 6import { join } from 'path'
7import { HttpStatusCode } from '@shared/models'
8import { 7import {
9 buildAbsoluteFixturePath, 8 buildAbsoluteFixturePath,
10 cleanupTests, 9 cleanupTests,
11 doubleFollow,
12 createMultipleServers, 10 createMultipleServers,
11 doubleFollow,
13 generateHighBitrateVideo, 12 generateHighBitrateVideo,
14 generateVideoWithFramerate, 13 generateVideoWithFramerate,
15 makeGetRequest, 14 makeGetRequest,
@@ -18,7 +17,7 @@ import {
18 waitJobs, 17 waitJobs,
19 webtorrentAdd 18 webtorrentAdd
20} from '@shared/extra-utils' 19} from '@shared/extra-utils'
21import { getMaxBitrate, VideoResolution, VideoState } from '@shared/models' 20import { getMaxBitrate, HttpStatusCode, VideoResolution, VideoState } from '@shared/models'
22import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants' 21import { VIDEO_TRANSCODING_FPS } from '../../../../server/initializers/constants'
23import { 22import {
24 canDoQuickTranscode, 23 canDoQuickTranscode,
diff --git a/server/tests/api/videos/videos-filter.ts b/server/tests/api/videos/videos-filter.ts
index 88dff3e7f..2306807bf 100644
--- a/server/tests/api/videos/videos-filter.ts
+++ b/server/tests/api/videos/videos-filter.ts
@@ -2,16 +2,15 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 doubleFollow,
9 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
10 makeGetRequest, 9 makeGetRequest,
11 PeerTubeServer, 10 PeerTubeServer,
12 setAccessTokensToServers 11 setAccessTokensToServers
13} from '@shared/extra-utils' 12} from '@shared/extra-utils'
14import { UserRole, Video, VideoPrivacy } from '@shared/models' 13import { HttpStatusCode, UserRole, Video, VideoPrivacy } from '@shared/models'
15 14
16async function getVideosNames (server: PeerTubeServer, token: string, filter: string, expectedStatus = HttpStatusCode.OK_200) { 15async function getVideosNames (server: PeerTubeServer, token: string, filter: string, expectedStatus = HttpStatusCode.OK_200) {
17 const paths = [ 16 const paths = [
diff --git a/server/tests/api/videos/videos-history.ts b/server/tests/api/videos/videos-history.ts
index acb9d1a46..e4bc0bb3a 100644
--- a/server/tests/api/videos/videos-history.ts
+++ b/server/tests/api/videos/videos-history.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createSingleServer, 7 createSingleServer,
@@ -12,7 +11,7 @@ import {
12 setAccessTokensToServers, 11 setAccessTokensToServers,
13 wait 12 wait
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
15import { Video } from '@shared/models' 14import { HttpStatusCode, Video } from '@shared/models'
16 15
17const expect = chai.expect 16const expect = chai.expect
18 17
diff --git a/server/tests/api/videos/videos-views-cleaner.ts b/server/tests/api/videos/videos-views-cleaner.ts
index 0be03ddd2..82268b1be 100644
--- a/server/tests/api/videos/videos-views-cleaner.ts
+++ b/server/tests/api/videos/videos-views-cleaner.ts
@@ -4,8 +4,8 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import {
6 cleanupTests, 6 cleanupTests,
7 doubleFollow,
8 createMultipleServers, 7 createMultipleServers,
8 doubleFollow,
9 killallServers, 9 killallServers,
10 PeerTubeServer, 10 PeerTubeServer,
11 setAccessTokensToServers, 11 setAccessTokensToServers,