- 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}" />`)
- })
+ expect(text).to.contain(`<meta property="og:title" content="${account.displayName}" />`)
+ expect(text).to.contain(`<meta property="og:description" content="${account.description}" />`)
+ expect(text).to.contain('<meta property="og:type" content="website" />')
+ expect(text).to.contain(`<meta property="og:url" content="${servers[0].url}/accounts/${servers[0].user.username}" />`)
+ }
+
+ async function channelPageTest (path: string) {
+ const res = await makeGetRequest({ url: servers[0].url, path, accept: 'text/html', statusCodeExpected: HttpStatusCode.OK_200 })
+ const text = res.text
+
+ expect(text).to.contain(`<meta property="og:title" content="${servers[0].videoChannel.displayName}" />`)
+ expect(text).to.contain(`<meta property="og:description" content="${channelDescription}" />`)
+ expect(text).to.contain('<meta property="og:type" content="website" />')
+ expect(text).to.contain(`<meta property="og:url" content="${servers[0].url}/video-channels/${servers[0].videoChannel.name}" />`)
+ }
+
+ async function watchVideoPageTest (path: string) {
+ const res = await makeGetRequest({ url: servers[0].url, path, accept: 'text/html', statusCodeExpected: HttpStatusCode.OK_200 })
+ const text = res.text
+
+ expect(text).to.contain(`<meta property="og:title" content="${videoName}" />`)
+ expect(text).to.contain(`<meta property="og:description" content="${videoDescriptionPlainText}" />`)
+ expect(text).to.contain('<meta property="og:type" content="video" />')
+ expect(text).to.contain(`<meta property="og:url" content="${servers[0].url}/w/${servers[0].video.uuid}" />`)
+ }
+
+ async function watchPlaylistPageTest (path: string) {
+ const res = await makeGetRequest({ url: servers[0].url, path, accept: 'text/html', statusCodeExpected: HttpStatusCode.OK_200 })
+ const text = res.text