+ await updateCustomConfig(server.url, server.accessToken, config)
+
+ const res = await request(server.url)
+ .get('/videos/watch/' + server.video.uuid)
+ .set('Accept', 'text/html')
+ .expect(200)
+
+ expect(res.text).to.contain('<meta property="twitter:card" content="player" />')
+ expect(res.text).to.contain('<meta property="twitter:site" content="@Kuja" />')
+ })
+
+ it('Should have valid index html tags (title, description...)', async function () {
+ const res = await makeHTMLRequest(server.url, '/videos/trending')
+
+ const description = 'PeerTube, an ActivityPub-federated video streaming platform using P2P directly in your web browser.'
+ checkIndexTags(res.text, 'PeerTube', description, '')
+ })
+
+ it('Should update the customized configuration and have the correct index html tags', async function () {
+ await updateCustomSubConfig(server.url, server.accessToken, {
+ instance: {
+ name: 'PeerTube updated',
+ shortDescription: 'my short description',
+ description: 'my super description',
+ terms: 'my super terms',
+ defaultClientRoute: '/videos/recently-added',
+ defaultNSFWPolicy: 'blur',
+ customizations: {
+ javascript: 'alert("coucou")',
+ css: 'body { background-color: red; }'
+ }
+ }
+ })
+
+ const res = await makeHTMLRequest(server.url, '/videos/trending')
+
+ checkIndexTags(res.text, 'PeerTube updated', 'my short description', 'body { background-color: red; }')
+ })
+
+ it('Should have valid index html updated tags (title, description...)', async function () {
+ const res = await makeHTMLRequest(server.url, '/videos/trending')
+
+ checkIndexTags(res.text, 'PeerTube updated', 'my short description', 'body { background-color: red; }')
+ })
+
+ after(async function () {
+ await cleanupTests([ server ])