+ for (const resolution of resolutions) {
+ const file = hlsFiles.find(f => f.resolution.id === resolution)
+ expect(file).to.not.be.undefined
+
+ expect(file.magnetUri).to.have.lengthOf.above(2)
+ expect(file.torrentUrl).to.equal(`${baseUrl}/static/torrents/${videoDetails.uuid}-${file.resolution.id}-hls.torrent`)
+ expect(file.fileUrl).to.equal(
+ `${baseUrl}/static/streaming-playlists/hls/${videoDetails.uuid}/${videoDetails.uuid}-${file.resolution.id}-fragmented.mp4`
+ )
+ expect(file.resolution.label).to.equal(resolution + 'p')
+
+ await makeRawRequest(file.torrentUrl, HttpStatusCode.OK_200)
+ await makeRawRequest(file.fileUrl, HttpStatusCode.OK_200)
+
+ const torrent = await webtorrentAdd(file.magnetUri, true)
+ expect(torrent.files).to.be.an('array')
+ expect(torrent.files.length).to.equal(1)
+ expect(torrent.files[0].path).to.exist.and.to.not.equal('')
+ }
+
+ {
+ await checkResolutionsInMasterPlaylist(hlsPlaylist.playlistUrl, resolutions)