diff options
Diffstat (limited to 'server/tests/utils')
-rw-r--r-- | server/tests/utils/index.ts | 1 | ||||
-rw-r--r-- | server/tests/utils/servers.ts | 2 | ||||
-rw-r--r-- | server/tests/utils/services.ts | 23 |
3 files changed, 26 insertions, 0 deletions
diff --git a/server/tests/utils/index.ts b/server/tests/utils/index.ts index 99c445887..90ee2d515 100644 --- a/server/tests/utils/index.ts +++ b/server/tests/utils/index.ts | |||
@@ -7,6 +7,7 @@ export * from './pods' | |||
7 | export * from './request-schedulers' | 7 | export * from './request-schedulers' |
8 | export * from './requests' | 8 | export * from './requests' |
9 | export * from './servers' | 9 | export * from './servers' |
10 | export * from './services' | ||
10 | export * from './users' | 11 | export * from './users' |
11 | export * from './video-abuses' | 12 | export * from './video-abuses' |
12 | export * from './video-blacklist' | 13 | export * from './video-blacklist' |
diff --git a/server/tests/utils/servers.ts b/server/tests/utils/servers.ts index 88027f74e..3526ffa51 100644 --- a/server/tests/utils/servers.ts +++ b/server/tests/utils/servers.ts | |||
@@ -23,6 +23,8 @@ interface ServerInfo { | |||
23 | video?: { | 23 | video?: { |
24 | id: number | 24 | id: number |
25 | uuid: string | 25 | uuid: string |
26 | name: string | ||
27 | author: string | ||
26 | } | 28 | } |
27 | 29 | ||
28 | remoteVideo?: { | 30 | remoteVideo?: { |
diff --git a/server/tests/utils/services.ts b/server/tests/utils/services.ts new file mode 100644 index 000000000..1a53dd4cf --- /dev/null +++ b/server/tests/utils/services.ts | |||
@@ -0,0 +1,23 @@ | |||
1 | import * as request from 'supertest' | ||
2 | |||
3 | function getOEmbed (url: string, oembedUrl: string, format?: string, maxHeight?: number, maxWidth?: number) { | ||
4 | const path = '/services/oembed' | ||
5 | const query = { | ||
6 | url: oembedUrl, | ||
7 | format, | ||
8 | maxheight: maxHeight, | ||
9 | maxwidth: maxWidth | ||
10 | } | ||
11 | |||
12 | return request(url) | ||
13 | .get(path) | ||
14 | .query(query) | ||
15 | .set('Accept', 'application/json') | ||
16 | .expect(200) | ||
17 | } | ||
18 | |||
19 | // --------------------------------------------------------------------------- | ||
20 | |||
21 | export { | ||
22 | getOEmbed | ||
23 | } | ||