- const oembedUrl = 'http://localhost:' + server.port + '/videos/watch/' + video.uuid
- const format = 'json'
- const maxHeight = 50
- const maxWidth = 50
-
- const res = await getOEmbed(server.url, oembedUrl, format, maxHeight, maxWidth)
- const expectedHtml = '<iframe width="50" height="50" sandbox="allow-same-origin allow-scripts" ' +
- `title="${video.name}" src="http://localhost:${server.port}/videos/embed/${video.uuid}" ` +
- 'frameborder="0" allowfullscreen></iframe>'
-
- expect(res.body.html).to.equal(expectedHtml)
- expect(res.body.title).to.equal(video.name)
- expect(res.body.author_name).to.equal(server.videoChannel.displayName)
- expect(res.body.height).to.equal(50)
- expect(res.body.width).to.equal(50)
- expect(res.body).to.not.have.property('thumbnail_url')
- expect(res.body).to.not.have.property('thumbnail_width')
- expect(res.body).to.not.have.property('thumbnail_height')
+ for (const basePath of [ '/videos/watch/', '/w/' ]) {
+ const oembedUrl = 'http://localhost:' + server.port + basePath + video.uuid
+ const format = 'json'
+ const maxHeight = 50
+ const maxWidth = 50
+
+ const res = await server.services.getOEmbed({ oembedUrl, format, maxHeight, maxWidth })
+ const expectedHtml = '<iframe width="50" height="50" sandbox="allow-same-origin allow-scripts" ' +
+ `title="${video.name}" src="http://localhost:${server.port}/videos/embed/${video.uuid}" ` +
+ 'frameborder="0" allowfullscreen></iframe>'
+
+ expect(res.body.html).to.equal(expectedHtml)
+ expect(res.body.title).to.equal(video.name)
+ expect(res.body.author_name).to.equal(server.store.channel.displayName)
+ expect(res.body.height).to.equal(50)
+ expect(res.body.width).to.equal(50)
+ expect(res.body).to.not.have.property('thumbnail_url')
+ expect(res.body).to.not.have.property('thumbnail_width')
+ expect(res.body).to.not.have.property('thumbnail_height')
+ }