aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/video-imports.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/video-imports.ts')
-rw-r--r--server/tests/api/check-params/video-imports.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts
index 6de6b40c8..a27b624d0 100644
--- a/server/tests/api/check-params/video-imports.ts
+++ b/server/tests/api/check-params/video-imports.ts
@@ -2,8 +2,9 @@
2 2
3import 'mocha' 3import 'mocha'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { join } from 'path' 5import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
6import { 6import {
7 buildAbsoluteFixturePath,
7 cleanupTests, 8 cleanupTests,
8 createUser, 9 createUser,
9 flushAndRunServer, 10 flushAndRunServer,
@@ -22,9 +23,8 @@ import {
22 checkBadSortPagination, 23 checkBadSortPagination,
23 checkBadStartPagination 24 checkBadStartPagination
24} from '../../../../shared/extra-utils/requests/check-api-params' 25} from '../../../../shared/extra-utils/requests/check-api-params'
25import { getMagnetURI, getGoodVideoUrl } from '../../../../shared/extra-utils/videos/video-imports' 26import { getGoodVideoUrl, getMagnetURI } from '../../../../shared/extra-utils/videos/video-imports'
26import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' 27import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum'
27import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
28 28
29describe('Test video imports API validator', function () { 29describe('Test video imports API validator', function () {
30 const path = '/api/v1/videos/imports' 30 const path = '/api/v1/videos/imports'
@@ -201,7 +201,7 @@ describe('Test video imports API validator', function () {
201 it('Should fail with an incorrect thumbnail file', async function () { 201 it('Should fail with an incorrect thumbnail file', async function () {
202 const fields = baseCorrectParams 202 const fields = baseCorrectParams
203 const attaches = { 203 const attaches = {
204 thumbnailfile: join(__dirname, '..', '..', 'fixtures', 'video_short.mp4') 204 thumbnailfile: buildAbsoluteFixturePath('video_short.mp4')
205 } 205 }
206 206
207 await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) 207 await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
@@ -210,7 +210,7 @@ describe('Test video imports API validator', function () {
210 it('Should fail with a big thumbnail file', async function () { 210 it('Should fail with a big thumbnail file', async function () {
211 const fields = baseCorrectParams 211 const fields = baseCorrectParams
212 const attaches = { 212 const attaches = {
213 thumbnailfile: join(__dirname, '..', '..', 'fixtures', 'preview-big.png') 213 thumbnailfile: buildAbsoluteFixturePath('preview-big.png')
214 } 214 }
215 215
216 await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) 216 await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
@@ -219,7 +219,7 @@ describe('Test video imports API validator', function () {
219 it('Should fail with an incorrect preview file', async function () { 219 it('Should fail with an incorrect preview file', async function () {
220 const fields = baseCorrectParams 220 const fields = baseCorrectParams
221 const attaches = { 221 const attaches = {
222 previewfile: join(__dirname, '..', '..', 'fixtures', 'video_short.mp4') 222 previewfile: buildAbsoluteFixturePath('video_short.mp4')
223 } 223 }
224 224
225 await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) 225 await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
@@ -228,7 +228,7 @@ describe('Test video imports API validator', function () {
228 it('Should fail with a big preview file', async function () { 228 it('Should fail with a big preview file', async function () {
229 const fields = baseCorrectParams 229 const fields = baseCorrectParams
230 const attaches = { 230 const attaches = {
231 previewfile: join(__dirname, '..', '..', 'fixtures', 'preview-big.png') 231 previewfile: buildAbsoluteFixturePath('preview-big.png')
232 } 232 }
233 233
234 await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) 234 await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
@@ -237,7 +237,7 @@ describe('Test video imports API validator', function () {
237 it('Should fail with an invalid torrent file', async function () { 237 it('Should fail with an invalid torrent file', async function () {
238 const fields = omit(baseCorrectParams, 'targetUrl') 238 const fields = omit(baseCorrectParams, 'targetUrl')
239 const attaches = { 239 const attaches = {
240 torrentfile: join(__dirname, '..', '..', 'fixtures', 'avatar-big.png') 240 torrentfile: buildAbsoluteFixturePath('avatar-big.png')
241 } 241 }
242 242
243 await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches }) 243 await makeUploadRequest({ url: server.url, path, token: server.accessToken, fields, attaches })
@@ -312,7 +312,7 @@ describe('Test video imports API validator', function () {
312 312
313 fields = omit(fields, 'magnetUri') 313 fields = omit(fields, 'magnetUri')
314 const attaches = { 314 const attaches = {
315 torrentfile: join(__dirname, '..', '..', 'fixtures', 'video-720p.torrent') 315 torrentfile: buildAbsoluteFixturePath('video-720p.torrent')
316 } 316 }
317 317
318 await makeUploadRequest({ 318 await makeUploadRequest({