diff options
Diffstat (limited to 'server/tests/utils/videos')
-rw-r--r-- | server/tests/utils/videos/video-imports.ts | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/server/tests/utils/videos/video-imports.ts b/server/tests/utils/videos/video-imports.ts new file mode 100644 index 000000000..e0f916990 --- /dev/null +++ b/server/tests/utils/videos/video-imports.ts | |||
@@ -0,0 +1,37 @@ | |||
1 | import { VideoImportCreate } from '../../../../shared/models/videos' | ||
2 | import { makeGetRequest, makePostBodyRequest } from '..' | ||
3 | |||
4 | function getYoutubeVideoUrl () { | ||
5 | return 'https://youtu.be/msX3jv1XdvM' | ||
6 | } | ||
7 | |||
8 | function importVideo (url: string, token: string, attributes: VideoImportCreate) { | ||
9 | const path = '/api/v1/videos/imports' | ||
10 | |||
11 | return makePostBodyRequest({ | ||
12 | url, | ||
13 | path, | ||
14 | token, | ||
15 | fields: attributes, | ||
16 | statusCodeExpected: 200 | ||
17 | }) | ||
18 | } | ||
19 | |||
20 | function getMyVideoImports (url: string, token: string) { | ||
21 | const path = '/api/v1/users/me/videos/imports' | ||
22 | |||
23 | return makeGetRequest({ | ||
24 | url, | ||
25 | path, | ||
26 | token, | ||
27 | statusCodeExpected: 200 | ||
28 | }) | ||
29 | } | ||
30 | |||
31 | // --------------------------------------------------------------------------- | ||
32 | |||
33 | export { | ||
34 | getYoutubeVideoUrl, | ||
35 | importVideo, | ||
36 | getMyVideoImports | ||
37 | } | ||