- async function checkVideoServer1 (url: string, id: number | string) {
- const res = await getVideo(url, id)
- const video: VideoDetails = res.body
-
- expect(video.name).to.equal('small video - youtube')
- expect(video.category.label).to.equal('News')
- expect(video.licence.label).to.equal('Attribution')
- expect(video.language.label).to.equal('Unknown')
- expect(video.nsfw).to.be.false
- expect(video.description).to.equal('this is a super description')
- expect(video.tags).to.deep.equal([ 'tag1', 'tag2' ])
+ async function checkVideosServer1 (url: string, idHttp: string, idMagnet: string, idTorrent: string) {
+ const resHttp = await getVideo(url, idHttp)
+ const videoHttp: VideoDetails = resHttp.body
+
+ expect(videoHttp.name).to.equal('small video - youtube')
+ expect(videoHttp.category.label).to.equal('News')
+ expect(videoHttp.licence.label).to.equal('Attribution')
+ expect(videoHttp.language.label).to.equal('Unknown')
+ expect(videoHttp.nsfw).to.be.false
+ expect(videoHttp.description).to.equal('this is a super description')
+ expect(videoHttp.tags).to.deep.equal([ 'tag1', 'tag2' ])
+ expect(videoHttp.files).to.have.lengthOf(1)
+
+ const resMagnet = await getVideo(url, idMagnet)
+ const videoMagnet: VideoDetails = resMagnet.body
+ const resTorrent = await getVideo(url, idTorrent)
+ const videoTorrent: VideoDetails = resTorrent.body
+
+ for (const video of [ videoMagnet, videoTorrent ]) {
+ expect(video.category.label).to.equal('Misc')
+ expect(video.licence.label).to.equal('Unknown')
+ expect(video.language.label).to.equal('Unknown')
+ expect(video.nsfw).to.be.false
+ expect(video.description).to.equal('this is a super torrent description')
+ expect(video.tags).to.deep.equal([ 'tag_torrent1', 'tag_torrent2' ])
+ expect(video.files).to.have.lengthOf(1)
+ }