+ const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}`
+
+ await checkParamEmbed(server, embedUrl, HttpStatusCode.NOT_IMPLEMENTED_501, { format: 'xml' })
+ })
+
+ it('Should fail with a private video', async function () {
+ const embedUrl = `http://localhost:${server.port}/videos/watch/${privateVideo.uuid}`
+
+ await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403)
+ })
+
+ it('Should fail with an unlisted video with the int id', async function () {
+ const embedUrl = `http://localhost:${server.port}/videos/watch/${unlistedVideo.id}`
+
+ await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403)
+ })
+
+ it('Should succeed with an unlisted video using the uuid id', async function () {
+ for (const uuid of [ unlistedVideo.uuid, unlistedVideo.shortUUID ]) {
+ const embedUrl = `http://localhost:${server.port}/videos/watch/${uuid}`
+
+ await checkParamEmbed(server, embedUrl, HttpStatusCode.OK_200)
+ }
+ })
+
+ it('Should fail with a private playlist', async function () {
+ const embedUrl = `http://localhost:${server.port}/videos/watch/playlist/${privatePlaylist.uuid}`
+
+ await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403)
+ })
+
+ it('Should fail with an unlisted playlist using the int id', async function () {
+ const embedUrl = `http://localhost:${server.port}/videos/watch/playlist/${unlistedPlaylist.id}`
+
+ await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403)
+ })
+
+ it('Should succeed with an unlisted playlist using the uuid id', async function () {
+ for (const uuid of [ unlistedPlaylist.uuid, unlistedPlaylist.shortUUID ]) {
+ const embedUrl = `http://localhost:${server.port}/videos/watch/playlist/${uuid}`
+
+ await checkParamEmbed(server, embedUrl, HttpStatusCode.OK_200)
+ }
+ })
+
+ it('Should succeed with the correct params with a video', async function () {
+ const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}`
+ const query = {
+ format: 'json',
+ maxheight: 400,
+ maxwidth: 400
+ }
+
+ await checkParamEmbed(server, embedUrl, HttpStatusCode.OK_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, HttpStatusCode.OK_200, query)