+ const resConfig = await getConfig(servers[0].url)
+ const res = await makeHTMLRequest(servers[0].url, '/videos/trending')
+
+ checkIndexTags(res.text, 'PeerTube updated', 'my short description', 'body { background-color: red; }', resConfig.body)
+ })
+
+ it('Should use the original video URL for the canonical tag', async function () {
+ for (const basePath of watchVideoBasePaths) {
+ const res = await makeHTMLRequest(servers[1].url, basePath + servers[0].video.uuid)
+ expect(res.text).to.contain(`<link rel="canonical" href="${servers[0].url}/videos/watch/${servers[0].video.uuid}" />`)
+ }
+ })
+
+ it('Should use the original account URL for the canonical tag', async function () {
+ const accountURLtest = (res) => {
+ expect(res.text).to.contain(`<link rel="canonical" href="${servers[0].url}/accounts/root" />`)
+ }
+
+ accountURLtest(await makeHTMLRequest(servers[1].url, '/accounts/root@' + servers[0].host))
+ accountURLtest(await makeHTMLRequest(servers[1].url, '/a/root@' + servers[0].host))
+ accountURLtest(await makeHTMLRequest(servers[1].url, '/@root@' + servers[0].host))
+ })
+
+ it('Should use the original channel URL for the canonical tag', async function () {
+ const channelURLtests = (res) => {
+ expect(res.text).to.contain(`<link rel="canonical" href="${servers[0].url}/video-channels/root_channel" />`)
+ }
+
+ channelURLtests(await makeHTMLRequest(servers[1].url, '/video-channels/root_channel@' + servers[0].host))
+ channelURLtests(await makeHTMLRequest(servers[1].url, '/c/root_channel@' + servers[0].host))
+ channelURLtests(await makeHTMLRequest(servers[1].url, '/@root_channel@' + servers[0].host))
+ })
+
+ it('Should use the original playlist URL for the canonical tag', async function () {
+ for (const basePath of watchPlaylistBasePaths) {
+ const res = await makeHTMLRequest(servers[1].url, basePath + playlistUUID)
+ expect(res.text).to.contain(`<link rel="canonical" href="${servers[0].url}/video-playlists/${playlistUUID}" />`)
+ }
+ })
+ })
+
+ describe('Embed HTML', function () {
+
+ it('Should have the correct embed html tags', async function () {
+ const resConfig = await getConfig(servers[0].url)
+ const res = await makeHTMLRequest(servers[0].url, servers[0].video.embedPath)