aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-29 14:32:51 +0100
committerChocobozzz <me@florianbigard.com>2017-12-29 14:32:51 +0100
commit8b0d42ee372de6589796be26b83e5bffb1b69cdf (patch)
tree7e07bc3f40dc3285a090c030aca457a32eb1c7f8 /server/tests
parentb1f5b93e4f1a9ae9015463c9a4946722ed87ec2e (diff)
downloadPeerTube-8b0d42ee372de6589796be26b83e5bffb1b69cdf.tar.gz
PeerTube-8b0d42ee372de6589796be26b83e5bffb1b69cdf.tar.zst
PeerTube-8b0d42ee372de6589796be26b83e5bffb1b69cdf.zip
Fix tests
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/server/follows.ts4
-rw-r--r--server/tests/api/videos/multiple-servers.ts4
-rw-r--r--server/tests/api/videos/services.ts22
-rw-r--r--server/tests/api/videos/single-server.ts29
4 files changed, 15 insertions, 44 deletions
diff --git a/server/tests/api/server/follows.ts b/server/tests/api/server/follows.ts
index 311631aae..fc9c5c3b6 100644
--- a/server/tests/api/server/follows.ts
+++ b/server/tests/api/server/follows.ts
@@ -10,7 +10,7 @@ import {
10 flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo, 10 flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo,
11 wait 11 wait
12} from '../../utils/index' 12} from '../../utils/index'
13import { dateIsValid, webtorrentAdd } from '../../utils/miscs/miscs' 13import { dateIsValid } from '../../utils/miscs/miscs'
14import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../../utils/server/follows' 14import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../../utils/server/follows'
15import { userLogin } from '../../utils/users/login' 15import { userLogin } from '../../utils/users/login'
16import { createUser } from '../../utils/users/users' 16import { createUser } from '../../utils/users/users'
@@ -18,7 +18,7 @@ import {
18 addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads, 18 addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
19 getVideoThreadComments 19 getVideoThreadComments
20} from '../../utils/videos/video-comments' 20} from '../../utils/videos/video-comments'
21import { getVideo, rateVideo, testVideoImage } from '../../utils/videos/videos' 21import { rateVideo } from '../../utils/videos/videos'
22 22
23const expect = chai.expect 23const expect = chai.expect
24 24
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index d35d1204a..abd051a30 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -98,7 +98,7 @@ describe('Test multiple servers', function () {
98 description: 'super channel', 98 description: 'super channel',
99 isLocal 99 isLocal
100 }, 100 },
101 fixture: 'video_short.webm', 101 fixture: 'video_short1.webm',
102 files: [ 102 files: [
103 { 103 {
104 resolution: 720, 104 resolution: 720,
@@ -289,7 +289,7 @@ describe('Test multiple servers', function () {
289 description: '', 289 description: '',
290 isLocal 290 isLocal
291 }, 291 },
292 fixture: 'video_short3.webm', 292 fixture: 'video_short.webm',
293 files: [ 293 files: [
294 { 294 {
295 resolution: 720, 295 resolution: 720,
diff --git a/server/tests/api/videos/services.ts b/server/tests/api/videos/services.ts
index b3167aebc..699f79ab7 100644
--- a/server/tests/api/videos/services.ts
+++ b/server/tests/api/videos/services.ts
@@ -1,20 +1,12 @@
1/* tslint:disable:no-unused-expression */ 1/* tslint:disable:no-unused-expression */
2 2
3import 'mocha'
4import * as chai from 'chai' 3import * as chai from 'chai'
5const expect = chai.expect 4import 'mocha'
6 5import { flushTests, getOEmbed, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index'
7import {
8 ServerInfo,
9 flushTests,
10 uploadVideo,
11 getVideosList,
12 setAccessTokensToServers,
13 killallServers,
14 getOEmbed
15} from '../../utils/index'
16import { runServer } from '../../utils/server/servers' 6import { runServer } from '../../utils/server/servers'
17 7
8const expect = chai.expect
9
18describe('Test services', function () { 10describe('Test services', function () {
19 let server: ServerInfo = null 11 let server: ServerInfo = null
20 12
@@ -30,8 +22,10 @@ describe('Test services', function () {
30 const videoAttributes = { 22 const videoAttributes = {
31 name: 'my super name' 23 name: 'my super name'
32 } 24 }
33 const res = await uploadVideo(server.url, server.accessToken, videoAttributes) 25 await uploadVideo(server.url, server.accessToken, videoAttributes)
34 server.video = res.body.video 26
27 const res = await getVideosList(server.url)
28 server.video = res.body.data[0]
35 }) 29 })
36 30
37 it('Should have a valid oEmbed response', async function () { 31 it('Should have a valid oEmbed response', async function () {
diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts
index 934c653b1..2a3126f32 100644
--- a/server/tests/api/videos/single-server.ts
+++ b/server/tests/api/videos/single-server.ts
@@ -6,32 +6,9 @@ import 'mocha'
6import { join } from 'path' 6import { join } from 'path'
7import { VideoPrivacy } from '../../../../shared/models/videos' 7import { VideoPrivacy } from '../../../../shared/models/videos'
8import { 8import {
9 dateIsValid, 9 completeVideoCheck, flushTests, getVideo, getVideoCategories, getVideoLanguages, getVideoLicences, getVideoPrivacies,
10 flushTests, 10 getVideosList, getVideosListPagination, getVideosListSort, killallServers, rateVideo, readdirPromise, removeVideo, runServer, searchVideo,
11 getVideo, 11 searchVideoWithPagination, searchVideoWithSort, ServerInfo, setAccessTokensToServers, testVideoImage, updateVideo, uploadVideo, viewVideo
12 getVideoCategories,
13 getVideoLanguages,
14 getVideoLicences,
15 getVideoPrivacies,
16 getVideosList,
17 getVideosListPagination,
18 getVideosListSort,
19 killallServers,
20 rateVideo,
21 readdirPromise,
22 removeVideo,
23 runServer,
24 searchVideo,
25 searchVideoWithPagination,
26 searchVideoWithSort,
27 ServerInfo,
28 setAccessTokensToServers,
29 testVideoImage,
30 updateVideo,
31 uploadVideo,
32 wait,
33 webtorrentAdd,
34 viewVideo, completeVideoCheck, immutableAssign
35} from '../../utils' 12} from '../../utils'
36 13
37const expect = chai.expect 14const expect = chai.expect