Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix services tests

Chocobozzza4d9c461bba3
diff --git a/packages/tests/src/api/server/services.ts b/packages/tests/src/api/server/services.ts
index b875d80e82..c6074f25c7 100644
--- a/packages/tests/src/api/server/services.ts
+++ b/packages/tests/src/api/server/services.ts
@@ -12,8 +12,11 @@ import {
describe('Test services', function () {
let server: PeerTubeServer = null
+
+ let playlistShortUUID: string
let playlistUUID: string
let playlistDisplayName: string
+
let video: Video
const urlSuffixes = [
@@ -57,6 +60,7 @@ describe('Test services', function () {
})
playlistUUID = created.uuid
+ playlistShortUUID = created.shortUUID
playlistDisplayName = 'The Life and Times of Scrooge McDuck'
await server.playlists.addElement({
@@ -75,7 +79,7 @@ describe('Test services', function () {
const res = await server.services.getOEmbed({ oembedUrl })
const expectedHtml = '<iframe width="560" height="315" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" ' +
- `title="${video.name}" src="http://${server.host}/videos/embed/${video.uuid}${suffix.output}" ` +
+ `title="${video.name}" src="http://${server.host}/videos/embed/${video.shortUUID}${suffix.output}" ` +
'frameborder="0" allowfullscreen></iframe>'
const expectedThumbnailUrl = 'http://' + server.host + video.previewPath
@@ -99,7 +103,7 @@ describe('Test services', function () {
const res = await server.services.getOEmbed({ oembedUrl })
const expectedHtml = '<iframe width="560" height="315" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" ' +
- `title="${playlistDisplayName}" src="http://${server.host}/video-playlists/embed/${playlistUUID}${suffix.output}" ` +
+ `title="${playlistDisplayName}" src="http://${server.host}/video-playlists/embed/${playlistShortUUID}${suffix.output}" ` +
'frameborder="0" allowfullscreen></iframe>'
expect(res.body.html).to.equal(expectedHtml)
@@ -120,7 +124,7 @@ describe('Test services', function () {
const res = await server.services.getOEmbed({ oembedUrl })
const expectedHtml = '<iframe width="560" height="315" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" ' +
- `title="${video.name}" src="http://${server.host}/videos/embed/${video.uuid}${query}" ` +
+ `title="${video.name}" src="http://${server.host}/videos/embed/${video.shortUUID}${query}" ` +
'frameborder="0" allowfullscreen></iframe>'
expect(res.body.html).to.equal(expectedHtml)
@@ -135,7 +139,7 @@ describe('Test services', function () {
const res = await server.services.getOEmbed({ oembedUrl, format, maxHeight, maxWidth })
const expectedHtml = '<iframe width="50" height="50" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" ' +
- `title="${video.name}" src="http://${server.host}/videos/embed/${video.uuid}" ` +
+ `title="${video.name}" src="http://${server.host}/videos/embed/${video.shortUUID}" ` +
'frameborder="0" allowfullscreen></iframe>'
expect(res.body.html).to.equal(expectedHtml)