aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/client.ts
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/client.ts
parent334ddfa47120ae53bc2643792ec5e1065a4d1141 (diff)
downloadPeerTube-d8755eed1e452d2efbfc983af0e9d228d152bf6b.tar.gz
PeerTube-d8755eed1e452d2efbfc983af0e9d228d152bf6b.tar.zst
PeerTube-d8755eed1e452d2efbfc983af0e9d228d152bf6b.zip
Add oembed endpoint
Diffstat (limited to 'server/tests/client.ts')
-rw-r--r--server/tests/client.ts17
1 files changed, 15 insertions, 2 deletions
diff --git a/server/tests/client.ts b/server/tests/client.ts
index 5e5abba5a..5f947ed2b 100644
--- a/server/tests/client.ts
+++ b/server/tests/client.ts
@@ -39,7 +39,7 @@ describe('Test a client controllers', function () {
39 server.video = videos[0] 39 server.video = videos[0]
40 }) 40 })
41 41
42 it('It should have valid Open Graph tags on the watch page with video id', async function () { 42 it('Should have valid Open Graph tags on the watch page with video id', async function () {
43 const res = await request(server.url) 43 const res = await request(server.url)
44 .get('/videos/watch/' + server.video.id) 44 .get('/videos/watch/' + server.video.id)
45 .expect(200) 45 .expect(200)
@@ -48,7 +48,7 @@ describe('Test a client controllers', function () {
48 expect(res.text).to.contain('<meta property="og:description" content="my super description for pod 1" />') 48 expect(res.text).to.contain('<meta property="og:description" content="my super description for pod 1" />')
49 }) 49 })
50 50
51 it('It should have valid Open Graph tags on the watch page with video uuid', async function () { 51 it('Should have valid Open Graph tags on the watch page with video uuid', async function () {
52 const res = await request(server.url) 52 const res = await request(server.url)
53 .get('/videos/watch/' + server.video.uuid) 53 .get('/videos/watch/' + server.video.uuid)
54 .expect(200) 54 .expect(200)
@@ -57,6 +57,19 @@ describe('Test a client controllers', function () {
57 expect(res.text).to.contain('<meta property="og:description" content="my super description for pod 1" />') 57 expect(res.text).to.contain('<meta property="og:description" content="my super description for pod 1" />')
58 }) 58 })
59 59
60 it('Should have valid oEmbed discovery tags', async function () {
61 const path = '/videos/watch/' + server.video.uuid
62 const res = await request(server.url)
63 .get(path)
64 .expect(200)
65
66 const expectedLink = '<link rel="alternate" type="application/json+oembed" href="http://localhost:9001/services/oembed?' +
67 `url=http%3A%2F%2Flocalhost%3A9001%2Fvideos%2Fwatch%2F${server.video.uuid}" ` +
68 `title="${server.video.name}" />`
69
70 expect(res.text).to.contain(expectedLink)
71 })
72
60 after(async function () { 73 after(async function () {
61 process.kill(-server.app.pid) 74 process.kill(-server.app.pid)
62 75