+ expect(text).to.contain('<meta property="twitter:card" content="summary" />')
+ expect(text).to.contain('<meta property="twitter:site" content="@Kuja" />')
+ }
+
+ 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="twitter:card" content="player" />')
+ expect(text).to.contain('<meta property="twitter:site" content="@Kuja" />')
+ }
+
+ 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
+
+ expect(text).to.contain('<meta property="twitter:card" content="player" />')
+ expect(text).to.contain('<meta property="twitter:site" content="@Kuja" />')
+ }
+
+ it('Should have valid twitter card on the watch video page', async function () {
+ await watchVideoPageTest('/videos/watch/' + servers[0].video.id)
+ await watchVideoPageTest('/videos/watch/' + servers[0].video.uuid)
+ await watchVideoPageTest('/w/' + servers[0].video.uuid)
+ await watchVideoPageTest('/w/' + servers[0].video.id)
+ })
+
+ it('Should have valid twitter card on the watch playlist page', async function () {
+ await watchPlaylistPageTest('/videos/watch/playlist/' + playlistUUID)
+ await watchPlaylistPageTest('/w/p/' + playlistUUID)
+ })
+
+ it('Should have valid twitter card on the account page', async function () {
+ await accountPageTest('/accounts/' + account.name)
+ await accountPageTest('/a/' + account.name)
+ await accountPageTest('/@' + account.name)
+ })
+
+ it('Should have valid twitter card on the channel page', async function () {
+ await channelPageTest('/video-channels/' + servers[0].videoChannel.name)
+ await channelPageTest('/c/' + servers[0].videoChannel.name)
+ await channelPageTest('/@' + servers[0].videoChannel.name)
+ })
+ })