Fix tests
authorChocobozzz <me@florianbigard.com>
Fri, 29 Dec 2017 13:32:51 +0000 (14:32 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 29 Dec 2017 13:32:51 +0000 (14:32 +0100)
server/tests/api/server/follows.ts
server/tests/api/videos/multiple-servers.ts
server/tests/api/videos/services.ts
server/tests/api/videos/single-server.ts

index 311631aae6baa3cfdb2284ef31c5fc3f58bdac2a..fc9c5c3b680fa430245a3fa4267f19e726757b79 100644 (file)
@@ -10,7 +10,7 @@ import {
   flushAndRunMultipleServers, flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo,
   wait
 } from '../../utils/index'
-import { dateIsValid, webtorrentAdd } from '../../utils/miscs/miscs'
+import { dateIsValid } from '../../utils/miscs/miscs'
 import { follow, getFollowersListPaginationAndSort, getFollowingListPaginationAndSort, unfollow } from '../../utils/server/follows'
 import { userLogin } from '../../utils/users/login'
 import { createUser } from '../../utils/users/users'
@@ -18,7 +18,7 @@ import {
   addVideoCommentReply, addVideoCommentThread, getVideoCommentThreads,
   getVideoThreadComments
 } from '../../utils/videos/video-comments'
-import { getVideo, rateVideo, testVideoImage } from '../../utils/videos/videos'
+import { rateVideo } from '../../utils/videos/videos'
 
 const expect = chai.expect
 
index d35d1204a1f6a9492f7aa37beb986b6ed2824370..abd051a30f7c6637e43b4b4a8966138ad1a2e86a 100644 (file)
@@ -98,7 +98,7 @@ describe('Test multiple servers', function () {
             description: 'super channel',
             isLocal
           },
-          fixture: 'video_short.webm',
+          fixture: 'video_short1.webm',
           files: [
             {
               resolution: 720,
@@ -289,7 +289,7 @@ describe('Test multiple servers', function () {
             description: '',
             isLocal
           },
-          fixture: 'video_short3.webm',
+          fixture: 'video_short.webm',
           files: [
             {
               resolution: 720,
index b3167aebc70215082e0808f64042e3182f0ea686..699f79ab7268ffe8aa6e48b45120c9a0d2414bc5 100644 (file)
@@ -1,20 +1,12 @@
 /* tslint:disable:no-unused-expression */
 
-import 'mocha'
 import * as chai from 'chai'
-const expect = chai.expect
-
-import {
-  ServerInfo,
-  flushTests,
-  uploadVideo,
-  getVideosList,
-  setAccessTokensToServers,
-  killallServers,
-  getOEmbed
-} from '../../utils/index'
+import 'mocha'
+import { flushTests, getOEmbed, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index'
 import { runServer } from '../../utils/server/servers'
 
+const expect = chai.expect
+
 describe('Test services', function () {
   let server: ServerInfo = null
 
@@ -30,8 +22,10 @@ describe('Test services', function () {
     const videoAttributes = {
       name: 'my super name'
     }
-    const res = await uploadVideo(server.url, server.accessToken, videoAttributes)
-    server.video = res.body.video
+    await uploadVideo(server.url, server.accessToken, videoAttributes)
+
+    const res = await getVideosList(server.url)
+    server.video = res.body.data[0]
   })
 
   it('Should have a valid oEmbed response', async function () {
index 934c653b19dd0bfe992781fbbe70aa5a36668316..2a3126f3258df29ace508ab6c18d00dc458ff18f 100644 (file)
@@ -6,32 +6,9 @@ import 'mocha'
 import { join } from 'path'
 import { VideoPrivacy } from '../../../../shared/models/videos'
 import {
-  dateIsValid,
-  flushTests,
-  getVideo,
-  getVideoCategories,
-  getVideoLanguages,
-  getVideoLicences,
-  getVideoPrivacies,
-  getVideosList,
-  getVideosListPagination,
-  getVideosListSort,
-  killallServers,
-  rateVideo,
-  readdirPromise,
-  removeVideo,
-  runServer,
-  searchVideo,
-  searchVideoWithPagination,
-  searchVideoWithSort,
-  ServerInfo,
-  setAccessTokensToServers,
-  testVideoImage,
-  updateVideo,
-  uploadVideo,
-  wait,
-  webtorrentAdd,
-  viewVideo, completeVideoCheck, immutableAssign
+  completeVideoCheck, flushTests, getVideo, getVideoCategories, getVideoLanguages, getVideoLicences, getVideoPrivacies,
+  getVideosList, getVideosListPagination, getVideosListSort, killallServers, rateVideo, readdirPromise, removeVideo, runServer, searchVideo,
+  searchVideoWithPagination, searchVideoWithSort, ServerInfo, setAccessTokensToServers, testVideoImage, updateVideo, uploadVideo, viewVideo
 } from '../../utils'
 
 const expect = chai.expect