1 /* tslint:disable:no-unused-expression */
4 import * as chai from 'chai'
5 import * as request from 'supertest'
6 const expect = chai.expect
12 loginAndGetAccessToken,
17 describe('Test a client controllers', function () {
18 let server: ServerInfo
20 before(async function () {
25 server = await runServer(1)
26 server.accessToken = await loginAndGetAccessToken(server)
28 const videoAttributes = {
29 name: 'my super name for pod 1',
30 description: 'my super description for pod 1'
32 await uploadVideo(server.url, server.accessToken, videoAttributes)
34 const res = await getVideosList(server.url)
35 const videos = res.body.data
37 expect(videos.length).to.equal(1)
39 server.video = videos[0]
42 it('It should have valid Open Graph tags on the watch page with video id', async function () {
43 const res = await request(server.url)
44 .get('/videos/watch/' + server.video.id)
47 expect(res.text).to.contain('<meta property="og:title" content="my super name for pod 1" />')
48 expect(res.text).to.contain('<meta property="og:description" content="my super description for pod 1" />')
51 it('It should have valid Open Graph tags on the watch page with video uuid', async function () {
52 const res = await request(server.url)
53 .get('/videos/watch/' + server.video.uuid)
56 expect(res.text).to.contain('<meta property="og:title" content="my super name for pod 1" />')
57 expect(res.text).to.contain('<meta property="og:description" content="my super description for pod 1" />')
60 after(async function () {
61 process.kill(-server.app.pid)
63 // Keep the logs if the test failed