aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/create-import-video-file-job.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/cli/create-import-video-file-job.ts')
-rw-r--r--server/tests/cli/create-import-video-file-job.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/tests/cli/create-import-video-file-job.ts b/server/tests/cli/create-import-video-file-job.ts
index 9f1b57a2e..01817216e 100644
--- a/server/tests/cli/create-import-video-file-job.ts
+++ b/server/tests/cli/create-import-video-file-job.ts
@@ -37,7 +37,7 @@ async function checkFiles (video: VideoDetails, objectStorage: boolean) {
37} 37}
38 38
39function runTests (objectStorage: boolean) { 39function runTests (objectStorage: boolean) {
40 let video1UUID: string 40 let video1ShortId: string
41 let video2UUID: string 41 let video2UUID: string
42 42
43 let servers: PeerTubeServer[] = [] 43 let servers: PeerTubeServer[] = []
@@ -59,8 +59,8 @@ function runTests (objectStorage: boolean) {
59 59
60 // Upload two videos for our needs 60 // Upload two videos for our needs
61 { 61 {
62 const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video1' } }) 62 const { shortUUID } = await servers[0].videos.upload({ attributes: { name: 'video1' } })
63 video1UUID = uuid 63 video1ShortId = shortUUID
64 } 64 }
65 65
66 { 66 {
@@ -72,7 +72,7 @@ function runTests (objectStorage: boolean) {
72 }) 72 })
73 73
74 it('Should run a import job on video 1 with a lower resolution', async function () { 74 it('Should run a import job on video 1 with a lower resolution', async function () {
75 const command = `npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short-480.webm` 75 const command = `npm run create-import-video-file-job -- -v ${video1ShortId} -i server/tests/fixtures/video_short-480.webm`
76 await servers[0].cli.execWithEnv(command) 76 await servers[0].cli.execWithEnv(command)
77 77
78 await waitJobs(servers) 78 await waitJobs(servers)
@@ -81,8 +81,8 @@ function runTests (objectStorage: boolean) {
81 const { data: videos } = await server.videos.list() 81 const { data: videos } = await server.videos.list()
82 expect(videos).to.have.lengthOf(2) 82 expect(videos).to.have.lengthOf(2)
83 83
84 const video = videos.find(({ uuid }) => uuid === video1UUID) 84 const video = videos.find(({ shortUUID }) => shortUUID === video1ShortId)
85 const videoDetails = await server.videos.get({ id: video.uuid }) 85 const videoDetails = await server.videos.get({ id: video.shortUUID })
86 86
87 expect(videoDetails.files).to.have.lengthOf(2) 87 expect(videoDetails.files).to.have.lengthOf(2)
88 const [ originalVideo, transcodedVideo ] = videoDetails.files 88 const [ originalVideo, transcodedVideo ] = videoDetails.files
@@ -118,7 +118,7 @@ function runTests (objectStorage: boolean) {
118 }) 118 })
119 119
120 it('Should run a import job on video 2 with the same resolution and the same extension', async function () { 120 it('Should run a import job on video 2 with the same resolution and the same extension', async function () {
121 const command = `npm run create-import-video-file-job -- -v ${video1UUID} -i server/tests/fixtures/video_short2.webm` 121 const command = `npm run create-import-video-file-job -- -v ${video1ShortId} -i server/tests/fixtures/video_short2.webm`
122 await servers[0].cli.execWithEnv(command) 122 await servers[0].cli.execWithEnv(command)
123 123
124 await waitJobs(servers) 124 await waitJobs(servers)
@@ -127,7 +127,7 @@ function runTests (objectStorage: boolean) {
127 const { data: videos } = await server.videos.list() 127 const { data: videos } = await server.videos.list()
128 expect(videos).to.have.lengthOf(2) 128 expect(videos).to.have.lengthOf(2)
129 129
130 const video = videos.find(({ uuid }) => uuid === video1UUID) 130 const video = videos.find(({ shortUUID }) => shortUUID === video1ShortId)
131 const videoDetails = await server.videos.get({ id: video.uuid }) 131 const videoDetails = await server.videos.get({ id: video.uuid })
132 132
133 expect(videoDetails.files).to.have.lengthOf(2) 133 expect(videoDetails.files).to.have.lengthOf(2)