- const embedUrl = 'http://localhost:9001/videos/watch/' + server.video.uuid
-
- await request(server.url)
- .get(path)
- .query({
- url: embedUrl,
- format: 'xml'
- })
- .set('Accept', 'application/json')
- .set('Authorization', 'Bearer ' + server.accessToken)
- .expect(501)
+ const embedUrl = `http://localhost:${server.port}/videos/watch/${server.video.uuid}`
+
+ await checkParamEmbed(server, embedUrl, 501, { format: 'xml' })
+ })
+
+ it('Should succeed with the correct params with a video', async function () {
+ const embedUrl = `http://localhost:${server.port}/videos/watch/${server.video.uuid}`
+ const query = {
+ format: 'json',
+ maxheight: 400,
+ maxwidth: 400
+ }
+
+ await checkParamEmbed(server, embedUrl, 200, query)
+ })
+
+ it('Should succeed with the correct params with a playlist', async function () {
+ const embedUrl = `http://localhost:${server.port}/videos/watch/playlist/${playlistUUID}`
+ const query = {
+ format: 'json',
+ maxheight: 400,
+ maxwidth: 400
+ }
+
+ await checkParamEmbed(server, embedUrl, 200, query)