diff options
Diffstat (limited to 'server/tests/api/check-params/video-captions.ts')
-rw-r--r-- | server/tests/api/check-params/video-captions.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts index 2f049c03d..1ce2202d2 100644 --- a/server/tests/api/check-params/video-captions.ts +++ b/server/tests/api/check-params/video-captions.ts | |||
@@ -1,7 +1,10 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | |||
5 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
4 | import { | 6 | import { |
7 | buildAbsoluteFixturePath, | ||
5 | cleanupTests, | 8 | cleanupTests, |
6 | createUser, | 9 | createUser, |
7 | flushAndRunServer, | 10 | flushAndRunServer, |
@@ -13,9 +16,7 @@ import { | |||
13 | uploadVideo, | 16 | uploadVideo, |
14 | userLogin | 17 | userLogin |
15 | } from '../../../../shared/extra-utils' | 18 | } from '../../../../shared/extra-utils' |
16 | import { join } from 'path' | ||
17 | import { createVideoCaption } from '../../../../shared/extra-utils/videos/video-captions' | 19 | import { createVideoCaption } from '../../../../shared/extra-utils/videos/video-captions' |
18 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
19 | 20 | ||
20 | describe('Test video captions API validator', function () { | 21 | describe('Test video captions API validator', function () { |
21 | const path = '/api/v1/videos/' | 22 | const path = '/api/v1/videos/' |
@@ -51,7 +52,7 @@ describe('Test video captions API validator', function () { | |||
51 | describe('When adding video caption', function () { | 52 | describe('When adding video caption', function () { |
52 | const fields = { } | 53 | const fields = { } |
53 | const attaches = { | 54 | const attaches = { |
54 | captionfile: join(__dirname, '..', '..', 'fixtures', 'subtitle-good1.vtt') | 55 | captionfile: buildAbsoluteFixturePath('subtitle-good1.vtt') |
55 | } | 56 | } |
56 | 57 | ||
57 | it('Should fail without a valid uuid', async function () { | 58 | it('Should fail without a valid uuid', async function () { |
@@ -129,7 +130,7 @@ describe('Test video captions API validator', function () { | |||
129 | // We accept any file now | 130 | // We accept any file now |
130 | // it('Should fail with an invalid captionfile extension', async function () { | 131 | // it('Should fail with an invalid captionfile extension', async function () { |
131 | // const attaches = { | 132 | // const attaches = { |
132 | // 'captionfile': join(__dirname, '..', '..', 'fixtures', 'subtitle-bad.txt') | 133 | // 'captionfile': buildAbsoluteFixturePath('subtitle-bad.txt') |
133 | // } | 134 | // } |
134 | // | 135 | // |
135 | // const captionPath = path + videoUUID + '/captions/fr' | 136 | // const captionPath = path + videoUUID + '/captions/fr' |
@@ -171,7 +172,7 @@ describe('Test video captions API validator', function () { | |||
171 | // We don't check the file validity yet | 172 | // We don't check the file validity yet |
172 | // it('Should fail with an invalid captionfile srt', async function () { | 173 | // it('Should fail with an invalid captionfile srt', async function () { |
173 | // const attaches = { | 174 | // const attaches = { |
174 | // 'captionfile': join(__dirname, '..', '..', 'fixtures', 'subtitle-bad.srt') | 175 | // 'captionfile': buildAbsoluteFixturePath('subtitle-bad.srt') |
175 | // } | 176 | // } |
176 | // | 177 | // |
177 | // const captionPath = path + videoUUID + '/captions/fr' | 178 | // const captionPath = path + videoUUID + '/captions/fr' |