addVideoInPlaylist,
cleanupTests,
createVideoPlaylist,
- flushAndRunServer,
getAccount,
getCustomConfig,
getVideosList,
makeHTMLRequest,
ServerInfo,
- serverLogin,
setDefaultVideoChannel,
updateCustomConfig,
updateCustomSubConfig,
uploadVideo,
updateMyUser,
- updateVideoChannel
+ updateVideoChannel,
+ doubleFollow,
+ flushAndRunMultipleServers,
+ setAccessTokensToServers
} from '../../shared/extra-utils'
import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
}
describe('Test a client controllers', function () {
+ let servers: ServerInfo[] = []
let server: ServerInfo
let account: Account
+ let videoUUID: string
+ let videoOriginalUrl: string
const videoName = 'my super name for server 1'
const videoDescription = 'my super description for server 1'
before(async function () {
this.timeout(120000)
- server = await flushAndRunServer(1)
- server.accessToken = await serverLogin(server)
+ servers = await flushAndRunMultipleServers(2)
+ const server = servers[0]
+
+ await setAccessTokensToServers(servers)
+
+ {
+ const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video' })
+ videoUUID = res.body.video.uuid
+ videoOriginalUrl = res.body.video.url
+ }
+
+ await doubleFollow(servers[0], servers[1])
+
await setDefaultVideoChannel([ server ])
await updateVideoChannel(server.url, server.accessToken, server.videoChannel.name, { description: channelDescription })
checkIndexTags(res.text, 'PeerTube updated', 'my short description', 'body { background-color: red; }')
})
+
+ it('Should use the original video URL for the canonical tag', async function () {
+ const res = await makeHTMLRequest(servers[1].url, '/videos/watch/' + videoUUID)
+ expect(res.text).to.contain(`<link rel="canonical" href="${videoOriginalUrl}" />`)
+ })
})
after(async function () {