aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-16 10:05:49 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-16 10:07:26 +0200
commitd8755eed1e452d2efbfc983af0e9d228d152bf6b (patch)
treedb94181e7c993f67919f4ea2bb12f08401c437c2 /server/tests/utils
parent334ddfa47120ae53bc2643792ec5e1065a4d1141 (diff)
downloadPeerTube-d8755eed1e452d2efbfc983af0e9d228d152bf6b.tar.gz
PeerTube-d8755eed1e452d2efbfc983af0e9d228d152bf6b.tar.zst
PeerTube-d8755eed1e452d2efbfc983af0e9d228d152bf6b.zip
Add oembed endpoint
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/index.ts1
-rw-r--r--server/tests/utils/servers.ts2
-rw-r--r--server/tests/utils/services.ts23
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'
7export * from './request-schedulers' 7export * from './request-schedulers'
8export * from './requests' 8export * from './requests'
9export * from './servers' 9export * from './servers'
10export * from './services'
10export * from './users' 11export * from './users'
11export * from './video-abuses' 12export * from './video-abuses'
12export * from './video-blacklist' 13export * 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 @@
1import * as request from 'supertest'
2
3function 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
21export {
22 getOEmbed
23}