+ describe('Open Graph', function () {
+
+ it('Should have valid Open Graph tags on the account page', async function () {
+ const res = await request(server.url)
+ .get('/accounts/' + server.user.username)
+ .set('Accept', 'text/html')
+ .expect(200)
+
+ expect(res.text).to.contain(`<meta property="og:title" content="${account.displayName}" />`)
+ expect(res.text).to.contain(`<meta property="og:description" content="${account.description}" />`)
+ expect(res.text).to.contain('<meta property="og:type" content="website" />')
+ expect(res.text).to.contain(`<meta property="og:url" content="${server.url}/accounts/${server.user.username}" />`)
+ })
+
+ it('Should have valid Open Graph tags on the channel page', async function () {
+ const res = await request(server.url)
+ .get('/video-channels/' + server.videoChannel.name)
+ .set('Accept', 'text/html')
+ .expect(200)
+
+ expect(res.text).to.contain(`<meta property="og:title" content="${server.videoChannel.displayName}" />`)
+ expect(res.text).to.contain(`<meta property="og:description" content="${channelDescription}" />`)
+ expect(res.text).to.contain('<meta property="og:type" content="website" />')
+ expect(res.text).to.contain(`<meta property="og:url" content="${server.url}/video-channels/${server.videoChannel.name}" />`)
+ })
+
+ it('Should have valid Open Graph tags on the watch page with video id', async function () {
+ const res = await request(server.url)
+ .get('/videos/watch/' + server.video.id)
+ .set('Accept', 'text/html')
+ .expect(200)
+
+ expect(res.text).to.contain(`<meta property="og:title" content="${videoName}" />`)
+ expect(res.text).to.contain(`<meta property="og:description" content="${videoDescription}" />`)
+ expect(res.text).to.contain('<meta property="og:type" content="video" />')
+ expect(res.text).to.contain(`<meta property="og:url" content="${server.url}/videos/watch/${server.video.uuid}" />`)
+ })
+
+ it('Should have valid Open Graph tags on the watch page with video uuid', async function () {
+ const res = await request(server.url)
+ .get('/videos/watch/' + server.video.uuid)
+ .set('Accept', 'text/html')
+ .expect(200)
+
+ expect(res.text).to.contain(`<meta property="og:title" content="${videoName}" />`)
+ expect(res.text).to.contain(`<meta property="og:description" content="${videoDescription}" />`)
+ expect(res.text).to.contain('<meta property="og:type" content="video" />')
+ expect(res.text).to.contain(`<meta property="og:url" content="${server.url}/videos/watch/${server.video.uuid}" />`)
+ })
+
+ it('Should have valid Open Graph tags on the watch playlist page', async function () {
+ const res = await request(server.url)
+ .get('/videos/watch/playlist/' + playlistUUID)
+ .set('Accept', 'text/html')
+ .expect(200)