+/* eslint-disable no-unused-expressions */
+
'use strict'
const chai = require('chai')
}
function uploadVideo (podNumber, callback) {
- const name = 'my super video'
- const description = 'my super description'
- const tags = [ 'tag1', 'tag2' ]
- const fixture = 'video_short.webm'
+ const videoAttributes = {
+ tags: [ 'tag1', 'tag2' ]
+ }
const server = servers[podNumber - 1]
- return videosUtils.uploadVideo(server.url, server.accessToken, name, description, tags, fixture, callback)
+ return videosUtils.uploadVideo(server.url, server.accessToken, videoAttributes, callback)
}
function getVideos (podNumber, callback) {
getFriendsList(5, function (err, res) {
if (err) throw err
- expect(res.body.length).to.equal(0)
+ expect(res.body.data.length).to.equal(0)
done()
})
getFriendsList(i, function (err, res) {
if (err) throw err
- expect(res.body.length).to.equal(0)
+ expect(res.body.data.length).to.equal(0)
callback()
})
getFriendsList(i, function (err, res) {
if (err) throw err
- expect(res.body.length).to.equal(3)
+ expect(res.body.data.length).to.equal(3)
callback()
})
uploadVideo(2, next)
},
function (next) {
- setTimeout(next, 11000)
+ setTimeout(next, 22000)
},
// Rerun server 4
function (next) {
if (err) throw err
// Pod 4 didn't know pod 1 and 2 removed it
- expect(res.body.length).to.equal(3)
+ expect(res.body.data.length).to.equal(3)
next()
})
},
if (err) throw err
// Pod 4 should not be our friend
- const result = res.body
+ const result = res.body.data
expect(result.length).to.equal(3)
for (const pod of result) {
- expect(pod.url).not.equal(servers[3].url)
+ expect(pod.host).not.equal(servers[3].host)
}
done()