]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/server/handle-down.ts
Merge branch 'release/v1.2.0'
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / handle-down.ts
index 18a0d9ce3187d47d8bce71725adb221762de6841..cd7baadad6a1c499b8058e0feaade8baa915b5a7 100644 (file)
@@ -5,24 +5,30 @@ import 'mocha'
 import { JobState, Video } from '../../../../shared/models'
 import { VideoPrivacy } from '../../../../shared/models/videos'
 import { VideoCommentThreadTree } from '../../../../shared/models/videos/video-comment.model'
-import { completeVideoCheck, getVideo, immutableAssign, reRunServer, unfollow, viewVideo } from '../../utils'
+
 import {
+  completeVideoCheck,
   flushAndRunMultipleServers,
+  getVideo,
   getVideosList,
+  immutableAssign,
   killallServers,
+  reRunServer,
   ServerInfo,
   setAccessTokensToServers,
+  unfollow,
+  updateVideo,
   uploadVideo,
   wait
-} from '../../utils/index'
-import { follow, getFollowersListPaginationAndSort } from '../../utils/server/follows'
-import { getJobsListPaginationAndSort, waitJobs } from '../../utils/server/jobs'
+} from '../../../../shared/utils'
+import { follow, getFollowersListPaginationAndSort } from '../../../../shared/utils/server/follows'
+import { getJobsListPaginationAndSort, waitJobs } from '../../../../shared/utils/server/jobs'
 import {
   addVideoCommentReply,
   addVideoCommentThread,
   getVideoCommentThreads,
   getVideoThreadComments
-} from '../../utils/videos/video-comments'
+} from '../../../../shared/utils/videos/video-comments'
 
 const expect = chai.expect
 
@@ -71,7 +77,8 @@ describe('Test handle downs', function () {
     privacy: VideoPrivacy.PUBLIC,
     commentsEnabled: true,
     channel: {
-      name: 'Default root channel',
+      name: 'root_channel',
+      displayName: 'Main root channel',
       description: '',
       isLocal: false
     },
@@ -193,15 +200,15 @@ describe('Test handle downs', function () {
     expect(res.body.data).to.have.lengthOf(2)
   })
 
-  it('Should send a view to server 3, and automatically fetch the video', async function () {
+  it('Should send an update to server 3, and automatically fetch the video', async function () {
     this.timeout(15000)
 
     const res1 = await getVideosList(servers[2].url)
     expect(res1.body.data).to.be.an('array')
     expect(res1.body.data).to.have.lengthOf(11)
 
-    await viewVideo(servers[0].url, missedVideo1.uuid)
-    await viewVideo(servers[0].url, unlistedVideo.uuid)
+    await updateVideo(servers[0].url, servers[0].accessToken, missedVideo1.uuid, { })
+    await updateVideo(servers[0].url, servers[0].accessToken, unlistedVideo.uuid, { })
 
     await waitJobs(servers)