]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/cli/update-host.ts
Shared utils -> extra-utils
[github/Chocobozzz/PeerTube.git] / server / tests / cli / update-host.ts
index 811ea6a9f44f71871cb17fbeb466f535e593144b..2270ff4945d53acd91fe85cb2a26ad7e98f8eab5 100644 (file)
@@ -3,8 +3,8 @@
 import 'mocha'
 import * as chai from 'chai'
 import { VideoDetails } from '../../../shared/models/videos'
-import { waitJobs } from '../../../shared/utils/server/jobs'
-import { addVideoCommentThread } from '../../../shared/utils/videos/video-comments'
+import { waitJobs } from '../../../shared/extra-utils/server/jobs'
+import { addVideoCommentThread } from '../../../shared/extra-utils/videos/video-comments'
 import {
   addVideoChannel,
   createUser,
@@ -21,8 +21,8 @@ import {
   ServerInfo,
   setAccessTokensToServers,
   uploadVideo
-} from '../../../shared/utils'
-import { getAccountsList } from '../../../shared/utils/users/accounts'
+} from '../../../shared/extra-utils'
+import { getAccountsList } from '../../../shared/extra-utils/users/accounts'
 
 const expect = chai.expect
 
@@ -50,7 +50,7 @@ describe('Test update host scripts', function () {
     await uploadVideo(server.url, server.accessToken, videoAttributes)
 
     // Create a user
-    await createUser(server.url, server.accessToken, 'toto', 'coucou')
+    await createUser({ url: server.url, accessToken: server.accessToken, username: 'toto', password: 'coucou' })
 
     // Create channel
     const videoChannel = {
@@ -86,6 +86,13 @@ describe('Test update host scripts', function () {
       const { body } = await makeActivityPubGetRequest(server.url, '/videos/watch/' + video.uuid)
 
       expect(body.id).to.equal('http://localhost:9002/videos/watch/' + video.uuid)
+
+      const res = await getVideo(server.url, video.uuid)
+      const videoDetails: VideoDetails = res.body
+
+      expect(videoDetails.trackerUrls[0]).to.include(server.host)
+      expect(videoDetails.streamingPlaylists[0].playlistUrl).to.include(server.host)
+      expect(videoDetails.streamingPlaylists[0].segmentsSha256Url).to.include(server.host)
     }
   })
 
@@ -100,7 +107,7 @@ describe('Test update host scripts', function () {
     }
   })
 
-  it('Should have update accounts url', async function () {
+  it('Should have updated accounts url', async function () {
     const res = await getAccountsList(server.url)
     expect(res.body.total).to.equal(3)
 
@@ -112,7 +119,7 @@ describe('Test update host scripts', function () {
     }
   })
 
-  it('Should update torrent hosts', async function () {
+  it('Should have updated torrent hosts', async function () {
     this.timeout(30000)
 
     const res = await getVideosList(server.url)