aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/services.ts2
-rw-r--r--server/tests/api/check-params/video-comments.ts2
-rw-r--r--server/tests/api/index-fast.ts18
-rw-r--r--server/tests/api/index-slow.ts10
-rw-r--r--server/tests/api/server/config.ts (renamed from server/tests/api/config.ts)2
-rw-r--r--server/tests/api/server/follows.ts (renamed from server/tests/api/follows.ts)19
-rw-r--r--server/tests/api/server/jobs.ts (renamed from server/tests/api/jobs.ts)12
-rw-r--r--server/tests/api/users/users.ts (renamed from server/tests/api/users.ts)10
-rw-r--r--server/tests/api/videos/multiple-servers.ts (renamed from server/tests/api/multiple-servers.ts)13
-rw-r--r--server/tests/api/videos/services.ts (renamed from server/tests/api/services.ts)4
-rw-r--r--server/tests/api/videos/single-server.ts (renamed from server/tests/api/single-server.ts)4
-rw-r--r--server/tests/api/videos/video-abuse.ts (renamed from server/tests/api/video-abuse.ts)4
-rw-r--r--server/tests/api/videos/video-blacklist-management.ts (renamed from server/tests/api/video-blacklist-management.ts)4
-rw-r--r--server/tests/api/videos/video-blacklist.ts (renamed from server/tests/api/video-blacklist.ts)4
-rw-r--r--server/tests/api/videos/video-channels.ts (renamed from server/tests/api/video-channels.ts)4
-rw-r--r--server/tests/api/videos/video-comments.ts (renamed from server/tests/api/video-comments.ts)9
-rw-r--r--server/tests/api/videos/video-description.ts (renamed from server/tests/api/video-description.ts)4
-rw-r--r--server/tests/api/videos/video-privacy.ts (renamed from server/tests/api/video-privacy.ts)12
-rw-r--r--server/tests/api/videos/video-transcoder.ts (renamed from server/tests/api/video-transcoder.ts)2
19 files changed, 74 insertions, 65 deletions
diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts
index 780254df5..f82520574 100644
--- a/server/tests/api/check-params/services.ts
+++ b/server/tests/api/check-params/services.ts
@@ -9,7 +9,7 @@ import {
9 setAccessTokensToServers, 9 setAccessTokensToServers,
10 killallServers 10 killallServers
11} from '../../utils' 11} from '../../utils'
12import { getVideosList, uploadVideo } from '../../utils/videos' 12import { getVideosList, uploadVideo } from '../../utils/videos/videos'
13 13
14describe('Test services API validators', function () { 14describe('Test services API validators', function () {
15 let server 15 let server
diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts
index e8d7ddf38..f3832bd2c 100644
--- a/server/tests/api/check-params/video-comments.ts
+++ b/server/tests/api/check-params/video-comments.ts
@@ -3,7 +3,7 @@
3import 'mocha' 3import 'mocha'
4import * as request from 'supertest' 4import * as request from 'supertest'
5import { flushTests, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils' 5import { flushTests, killallServers, makePostBodyRequest, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils'
6import { addVideoCommentThread } from '../../utils/video-comments' 6import { addVideoCommentThread } from '../../utils/videos/video-comments'
7 7
8describe('Test video comments API validator', function () { 8describe('Test video comments API validator', function () {
9 let pathThread: string 9 let pathThread: string
diff --git a/server/tests/api/index-fast.ts b/server/tests/api/index-fast.ts
index 35b414383..e591d0fd2 100644
--- a/server/tests/api/index-fast.ts
+++ b/server/tests/api/index-fast.ts
@@ -1,11 +1,11 @@
1// Order of the tests we want to execute 1// Order of the tests we want to execute
2import './config' 2import './server/config'
3import './check-params' 3import './check-params'
4import './users' 4import './users/users'
5import './single-server' 5import './videos/single-server'
6import './video-abuse' 6import './videos/video-abuse'
7import './video-blacklist' 7import './videos/video-blacklist'
8import './video-blacklist-management' 8import './videos/video-blacklist-management'
9import './video-description' 9import './videos/video-description'
10import './video-privacy' 10import './videos/video-privacy'
11import './services' 11import './videos/services'
diff --git a/server/tests/api/index-slow.ts b/server/tests/api/index-slow.ts
index b525d6f01..23b6526c7 100644
--- a/server/tests/api/index-slow.ts
+++ b/server/tests/api/index-slow.ts
@@ -1,7 +1,7 @@
1// Order of the tests we want to execute 1// Order of the tests we want to execute
2// import './multiple-servers' 2// import './multiple-servers'
3import './video-transcoder' 3import './videos/video-transcoder'
4import './multiple-servers' 4import './videos/multiple-servers'
5import './follows' 5import './server/follows'
6import './jobs' 6import './server/jobs'
7import './video-comments' 7import './videos/video-comments'
diff --git a/server/tests/api/config.ts b/server/tests/api/server/config.ts
index 61ae57977..e8846c8db 100644
--- a/server/tests/api/config.ts
+++ b/server/tests/api/server/config.ts
@@ -9,7 +9,7 @@ import {
9 flushTests, 9 flushTests,
10 runServer, 10 runServer,
11 registerUser 11 registerUser
12} from '../utils' 12} from '../../utils/index'
13 13
14describe('Test config', function () { 14describe('Test config', function () {
15 let server = null 15 let server = null
diff --git a/server/tests/api/follows.ts b/server/tests/api/server/follows.ts
index 2ffa426a0..f77c0c67c 100644
--- a/server/tests/api/follows.ts
+++ b/server/tests/api/server/follows.ts
@@ -2,18 +2,21 @@
2 2
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model' 5import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
6 6
7import { 7import {
8 flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo, 8 flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo,
9 wait 9 wait
10} from '../utils' 10} from '../../utils/index'
11import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../utils/follows' 11import { dateIsValid, webtorrentAdd } from '../../utils/miscs/miscs'
12import { getUserAccessToken } from '../utils/login' 12import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../../utils/server/follows'
13import { dateIsValid, webtorrentAdd } from '../utils/miscs' 13import { getUserAccessToken } from '../../utils/users/login'
14import { createUser } from '../utils/users' 14import { createUser } from '../../utils/users/users'
15import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments' 15import {
16import { getVideo, rateVideo, testVideoImage } from '../utils/videos' 16 addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
17 getVideoThreadComments
18} from '../../utils/videos/video-comments'
19import { getVideo, rateVideo, testVideoImage } from '../../utils/videos/videos'
17 20
18const expect = chai.expect 21const expect = chai.expect
19 22
diff --git a/server/tests/api/jobs.ts b/server/tests/api/server/jobs.ts
index 4d9b61392..2e17e71a4 100644
--- a/server/tests/api/jobs.ts
+++ b/server/tests/api/server/jobs.ts
@@ -2,12 +2,12 @@
2 2
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { flushTests, killallServers, ServerInfo, setAccessTokensToServers, wait } from '../utils' 5import { flushTests, killallServers, ServerInfo, setAccessTokensToServers, wait } from '../../utils/index'
6import { doubleFollow } from '../utils/follows' 6import { doubleFollow } from '../../utils/server/follows'
7import { getJobsList, getJobsListPaginationAndSort } from '../utils/jobs' 7import { getJobsList, getJobsListPaginationAndSort } from '../../utils/server/jobs'
8import { flushAndRunMultipleServers } from '../utils/servers' 8import { flushAndRunMultipleServers } from '../../utils/server/servers'
9import { uploadVideo } from '../utils/videos' 9import { uploadVideo } from '../../utils/videos/videos'
10import { dateIsValid } from '../utils/miscs' 10import { dateIsValid } from '../../utils/miscs/miscs'
11 11
12const expect = chai.expect 12const expect = chai.expect
13 13
diff --git a/server/tests/api/users.ts b/server/tests/api/users/users.ts
index 67e4cc8c6..2e3a0b94f 100644
--- a/server/tests/api/users.ts
+++ b/server/tests/api/users/users.ts
@@ -2,7 +2,7 @@
2 2
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { UserRole } from '../../../shared' 5import { UserRole } from '../../../../shared/index'
6import { 6import {
7 createUser, 7 createUser,
8 flushTests, 8 flushTests,
@@ -26,10 +26,10 @@ import {
26 updateMyUser, 26 updateMyUser,
27 updateUser, 27 updateUser,
28 uploadVideo 28 uploadVideo
29} from '../utils' 29} from '../../utils/index'
30import { follow } from '../utils/follows' 30import { follow } from '../../utils/server/follows'
31import { getMyVideos } from '../utils/videos' 31import { getMyVideos } from '../../utils/videos/videos'
32import { setAccessTokensToServers } from '../utils/login' 32import { setAccessTokensToServers } from '../../utils/users/login'
33 33
34const expect = chai.expect 34const expect = chai.expect
35 35
diff --git a/server/tests/api/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index 06274d4cc..84f730a8e 100644
--- a/server/tests/api/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -4,16 +4,19 @@ import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { join } from 'path' 5import { join } from 'path'
6import * as request from 'supertest' 6import * as request from 'supertest'
7import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model' 7import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
8 8
9import { 9import {
10 addVideoChannel, dateIsValid, doubleFollow, flushAndRunMultipleServers, flushTests, getUserAccessToken, getVideo, 10 addVideoChannel, dateIsValid, doubleFollow, flushAndRunMultipleServers, flushTests, getUserAccessToken, getVideo,
11 getVideoChannelsList, getVideosList, killallServers, rateVideo, removeVideo, ServerInfo, setAccessTokensToServers, testVideoImage, 11 getVideoChannelsList, getVideosList, killallServers, rateVideo, removeVideo, ServerInfo, setAccessTokensToServers, testVideoImage,
12 updateVideo, uploadVideo, wait, webtorrentAdd 12 updateVideo, uploadVideo, wait, webtorrentAdd
13} from '../utils' 13} from '../../utils/index'
14import { createUser } from '../utils/users' 14import { createUser } from '../../utils/users/users'
15import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments' 15import {
16import { viewVideo } from '../utils/videos' 16 addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
17 getVideoThreadComments
18} from '../../utils/videos/video-comments'
19import { viewVideo } from '../../utils/videos/videos'
17 20
18const expect = chai.expect 21const expect = chai.expect
19 22
diff --git a/server/tests/api/services.ts b/server/tests/api/videos/services.ts
index 4d480c305..1cda464d9 100644
--- a/server/tests/api/services.ts
+++ b/server/tests/api/videos/services.ts
@@ -12,8 +12,8 @@ import {
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 killallServers, 13 killallServers,
14 getOEmbed 14 getOEmbed
15} from '../utils' 15} from '../../utils/index'
16import { runServer } from '../utils/servers' 16import { runServer } from '../../utils/server/servers'
17 17
18describe('Test services', function () { 18describe('Test services', function () {
19 let server: ServerInfo = null 19 let server: ServerInfo = null
diff --git a/server/tests/api/single-server.ts b/server/tests/api/videos/single-server.ts
index 7f4351f5e..02723654d 100644
--- a/server/tests/api/single-server.ts
+++ b/server/tests/api/videos/single-server.ts
@@ -30,8 +30,8 @@ import {
30 uploadVideo, 30 uploadVideo,
31 wait, 31 wait,
32 webtorrentAdd 32 webtorrentAdd
33} from '../utils' 33} from '../../utils/index'
34import { viewVideo } from '../utils/videos' 34import { viewVideo } from '../../utils/videos/videos'
35 35
36const expect = chai.expect 36const expect = chai.expect
37 37
diff --git a/server/tests/api/video-abuse.ts b/server/tests/api/videos/video-abuse.ts
index 4a0b6b504..3fcf5d8c7 100644
--- a/server/tests/api/video-abuse.ts
+++ b/server/tests/api/videos/video-abuse.ts
@@ -13,8 +13,8 @@ import {
13 setAccessTokensToServers, 13 setAccessTokensToServers,
14 uploadVideo, 14 uploadVideo,
15 wait 15 wait
16} from '../utils' 16} from '../../utils/index'
17import { doubleFollow } from '../utils/follows' 17import { doubleFollow } from '../../utils/server/follows'
18 18
19const expect = chai.expect 19const expect = chai.expect
20 20
diff --git a/server/tests/api/video-blacklist-management.ts b/server/tests/api/videos/video-blacklist-management.ts
index 0c636e094..db79784c2 100644
--- a/server/tests/api/video-blacklist-management.ts
+++ b/server/tests/api/videos/video-blacklist-management.ts
@@ -16,8 +16,8 @@ import {
16 setAccessTokensToServers, 16 setAccessTokensToServers,
17 uploadVideo, 17 uploadVideo,
18 wait 18 wait
19} from '../utils' 19} from '../../utils/index'
20import { doubleFollow } from '../utils/follows' 20import { doubleFollow } from '../../utils/server/follows'
21 21
22const expect = chai.expect 22const expect = chai.expect
23const orderBy = lodash.orderBy 23const orderBy = lodash.orderBy
diff --git a/server/tests/api/video-blacklist.ts b/server/tests/api/videos/video-blacklist.ts
index 3afd8c510..d1cefa5d7 100644
--- a/server/tests/api/video-blacklist.ts
+++ b/server/tests/api/videos/video-blacklist.ts
@@ -13,8 +13,8 @@ import {
13 setAccessTokensToServers, 13 setAccessTokensToServers,
14 uploadVideo, 14 uploadVideo,
15 wait 15 wait
16} from '../utils' 16} from '../../utils/index'
17import { doubleFollow } from '../utils/follows' 17import { doubleFollow } from '../../utils/server/follows'
18 18
19const expect = chai.expect 19const expect = chai.expect
20 20
diff --git a/server/tests/api/video-channels.ts b/server/tests/api/videos/video-channels.ts
index 2d8efb320..454a96da6 100644
--- a/server/tests/api/video-channels.ts
+++ b/server/tests/api/videos/video-channels.ts
@@ -17,8 +17,8 @@ import {
17 updateVideoChannel, 17 updateVideoChannel,
18 deleteVideoChannel, 18 deleteVideoChannel,
19 getVideoChannel 19 getVideoChannel
20} from '../utils' 20} from '../../utils/index'
21import { User } from '../../../shared' 21import { User } from '../../../../shared/index'
22 22
23describe('Test a video channels', function () { 23describe('Test a video channels', function () {
24 let server: ServerInfo 24 let server: ServerInfo
diff --git a/server/tests/api/video-comments.ts b/server/tests/api/videos/video-comments.ts
index f05ca5e81..3b6578f04 100644
--- a/server/tests/api/video-comments.ts
+++ b/server/tests/api/videos/video-comments.ts
@@ -2,9 +2,12 @@
2 2
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { VideoComment, VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model' 5import { VideoComment, VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
6import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../utils' 6import { dateIsValid, flushTests, killallServers, runServer, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index'
7import { addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, getVideoThreadComments } from '../utils/video-comments' 7import {
8 addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
9 getVideoThreadComments
10} from '../../utils/videos/video-comments'
8 11
9const expect = chai.expect 12const expect = chai.expect
10 13
diff --git a/server/tests/api/video-description.ts b/server/tests/api/videos/video-description.ts
index 7ad1c63ae..c2985194c 100644
--- a/server/tests/api/video-description.ts
+++ b/server/tests/api/videos/video-description.ts
@@ -14,8 +14,8 @@ import {
14 updateVideo, 14 updateVideo,
15 uploadVideo, 15 uploadVideo,
16 wait 16 wait
17} from '../utils' 17} from '../../utils/index'
18import { doubleFollow } from '../utils/follows' 18import { doubleFollow } from '../../utils/server/follows'
19 19
20const expect = chai.expect 20const expect = chai.expect
21 21
diff --git a/server/tests/api/video-privacy.ts b/server/tests/api/videos/video-privacy.ts
index 26847efce..de709f8f1 100644
--- a/server/tests/api/video-privacy.ts
+++ b/server/tests/api/videos/video-privacy.ts
@@ -2,7 +2,7 @@
2 2
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { VideoPrivacy } from '../../../shared/models/videos/video-privacy.enum' 5import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
6import { 6import {
7 flushAndRunMultipleServers, 7 flushAndRunMultipleServers,
8 flushTests, 8 flushTests,
@@ -12,11 +12,11 @@ import {
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 uploadVideo, 13 uploadVideo,
14 wait 14 wait
15} from '../utils' 15} from '../../utils/index'
16import { doubleFollow } from '../utils/follows' 16import { doubleFollow } from '../../utils/server/follows'
17import { getUserAccessToken } from '../utils/login' 17import { getUserAccessToken } from '../../utils/users/login'
18import { createUser } from '../utils/users' 18import { createUser } from '../../utils/users/users'
19import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../utils/videos' 19import { getMyVideos, getVideo, getVideoWithToken, updateVideo } from '../../utils/videos/videos'
20 20
21const expect = chai.expect 21const expect = chai.expect
22 22
diff --git a/server/tests/api/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index 9a6e91b76..27927a594 100644
--- a/server/tests/api/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -15,7 +15,7 @@ import {
15 killallServers, 15 killallServers,
16 webtorrentAdd, 16 webtorrentAdd,
17 getVideo 17 getVideo
18} from '../utils' 18} from '../../utils/index'
19 19
20describe('Test video transcoding', function () { 20describe('Test video transcoding', function () {
21 let servers: ServerInfo[] = [] 21 let servers: ServerInfo[] = []