]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/services.ts
Add tests for emails
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / services.ts
index b3167aebc70215082e0808f64042e3182f0ea686..e456184cf0dc91be908baa0ce00ca2a9c9f55d57 100644 (file)
@@ -1,25 +1,17 @@
 /* tslint:disable:no-unused-expression */
 
-import 'mocha'
 import * as chai from 'chai'
-const expect = chai.expect
-
-import {
-  ServerInfo,
-  flushTests,
-  uploadVideo,
-  getVideosList,
-  setAccessTokensToServers,
-  killallServers,
-  getOEmbed
-} from '../../utils/index'
+import 'mocha'
+import { flushTests, getOEmbed, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index'
 import { runServer } from '../../utils/server/servers'
 
+const expect = chai.expect
+
 describe('Test services', function () {
   let server: ServerInfo = null
 
   before(async function () {
-    this.timeout(10000)
+    this.timeout(30000)
 
     await flushTests()
 
@@ -30,8 +22,10 @@ describe('Test services', function () {
     const videoAttributes = {
       name: 'my super name'
     }
-    const res = await uploadVideo(server.url, server.accessToken, videoAttributes)
-    server.video = res.body.video
+    await uploadVideo(server.url, server.accessToken, videoAttributes)
+
+    const res = await getVideosList(server.url)
+    server.video = res.body.data[0]
   })
 
   it('Should have a valid oEmbed response', async function () {