+ describe('Open Graph', function () {
+
+ it('Should have valid Open Graph tags on the account page', async function () {
+ const res = await request(servers[0].url)
+ .get('/accounts/' + servers[0].user.username)
+ .set('Accept', 'text/html')
+ .expect(HttpStatusCode.OK_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="${servers[0].url}/accounts/${servers[0].user.username}" />`)
+ })
+
+ it('Should have valid Open Graph tags on the channel page', async function () {
+ const res = await request(servers[0].url)
+ .get('/video-channels/' + servers[0].videoChannel.name)
+ .set('Accept', 'text/html')
+ .expect(HttpStatusCode.OK_200)
+
+ expect(res.text).to.contain(`<meta property="og:title" content="${servers[0].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="${servers[0].url}/video-channels/${servers[0].videoChannel.name}" />`)
+ })
+
+ it('Should have valid Open Graph tags on the watch page with video id', async function () {
+ const res = await request(servers[0].url)
+ .get('/videos/watch/' + servers[0].video.id)
+ .set('Accept', 'text/html')
+ .expect(HttpStatusCode.OK_200)
+
+ expect(res.text).to.contain(`<meta property="og:title" content="${videoName}" />`)
+ expect(res.text).to.contain(`<meta property="og:description" content="${videoDescriptionPlainText}" />`)
+ expect(res.text).to.contain('<meta property="og:type" content="video" />')
+ expect(res.text).to.contain(`<meta property="og:url" content="${servers[0].url}/videos/watch/${servers[0].video.uuid}" />`)
+ })
+
+ it('Should have valid Open Graph tags on the watch page with video uuid', async function () {
+ const res = await request(servers[0].url)
+ .get('/videos/watch/' + servers[0].video.uuid)
+ .set('Accept', 'text/html')
+ .expect(HttpStatusCode.OK_200)
+
+ expect(res.text).to.contain(`<meta property="og:title" content="${videoName}" />`)
+ expect(res.text).to.contain(`<meta property="og:description" content="${videoDescriptionPlainText}" />`)
+ expect(res.text).to.contain('<meta property="og:type" content="video" />')
+ expect(res.text).to.contain(`<meta property="og:url" content="${servers[0].url}/videos/watch/${servers[0].video.uuid}" />`)
+ })
+
+ it('Should have valid Open Graph tags on the watch playlist page', async function () {
+ const res = await request(servers[0].url)
+ .get('/videos/watch/playlist/' + playlistUUID)
+ .set('Accept', 'text/html')
+ .expect(HttpStatusCode.OK_200)