diff options
Diffstat (limited to 'server/tests/api/videos/video-files.ts')
-rw-r--r-- | server/tests/api/videos/video-files.ts | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/server/tests/api/videos/video-files.ts b/server/tests/api/videos/video-files.ts index 8c913bf31..0a183c44d 100644 --- a/server/tests/api/videos/video-files.ts +++ b/server/tests/api/videos/video-files.ts | |||
@@ -48,10 +48,10 @@ describe('Test videos files', function () { | |||
48 | await waitJobs(servers) | 48 | await waitJobs(servers) |
49 | }) | 49 | }) |
50 | 50 | ||
51 | it('Should delete webtorrent files', async function () { | 51 | it('Should delete web video files', async function () { |
52 | this.timeout(30_000) | 52 | this.timeout(30_000) |
53 | 53 | ||
54 | await servers[0].videos.removeAllWebTorrentFiles({ videoId: validId1 }) | 54 | await servers[0].videos.removeAllWebVideoFiles({ videoId: validId1 }) |
55 | 55 | ||
56 | await waitJobs(servers) | 56 | await waitJobs(servers) |
57 | 57 | ||
@@ -80,15 +80,15 @@ describe('Test videos files', function () { | |||
80 | }) | 80 | }) |
81 | 81 | ||
82 | describe('When deleting a specific file', function () { | 82 | describe('When deleting a specific file', function () { |
83 | let webtorrentId: string | 83 | let webVideoId: string |
84 | let hlsId: string | 84 | let hlsId: string |
85 | 85 | ||
86 | before(async function () { | 86 | before(async function () { |
87 | this.timeout(120_000) | 87 | this.timeout(120_000) |
88 | 88 | ||
89 | { | 89 | { |
90 | const { uuid } = await servers[0].videos.quickUpload({ name: 'webtorrent' }) | 90 | const { uuid } = await servers[0].videos.quickUpload({ name: 'web-video' }) |
91 | webtorrentId = uuid | 91 | webVideoId = uuid |
92 | } | 92 | } |
93 | 93 | ||
94 | { | 94 | { |
@@ -99,38 +99,38 @@ describe('Test videos files', function () { | |||
99 | await waitJobs(servers) | 99 | await waitJobs(servers) |
100 | }) | 100 | }) |
101 | 101 | ||
102 | it('Shoulde delete a webtorrent file', async function () { | 102 | it('Shoulde delete a web video file', async function () { |
103 | this.timeout(30_000) | 103 | this.timeout(30_000) |
104 | 104 | ||
105 | const video = await servers[0].videos.get({ id: webtorrentId }) | 105 | const video = await servers[0].videos.get({ id: webVideoId }) |
106 | const files = video.files | 106 | const files = video.files |
107 | 107 | ||
108 | await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentId, fileId: files[0].id }) | 108 | await servers[0].videos.removeWebVideoFile({ videoId: webVideoId, fileId: files[0].id }) |
109 | 109 | ||
110 | await waitJobs(servers) | 110 | await waitJobs(servers) |
111 | 111 | ||
112 | for (const server of servers) { | 112 | for (const server of servers) { |
113 | const video = await server.videos.get({ id: webtorrentId }) | 113 | const video = await server.videos.get({ id: webVideoId }) |
114 | 114 | ||
115 | expect(video.files).to.have.lengthOf(files.length - 1) | 115 | expect(video.files).to.have.lengthOf(files.length - 1) |
116 | expect(video.files.find(f => f.id === files[0].id)).to.not.exist | 116 | expect(video.files.find(f => f.id === files[0].id)).to.not.exist |
117 | } | 117 | } |
118 | }) | 118 | }) |
119 | 119 | ||
120 | it('Should delete all webtorrent files', async function () { | 120 | it('Should delete all web video files', async function () { |
121 | this.timeout(30_000) | 121 | this.timeout(30_000) |
122 | 122 | ||
123 | const video = await servers[0].videos.get({ id: webtorrentId }) | 123 | const video = await servers[0].videos.get({ id: webVideoId }) |
124 | const files = video.files | 124 | const files = video.files |
125 | 125 | ||
126 | for (const file of files) { | 126 | for (const file of files) { |
127 | await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentId, fileId: file.id }) | 127 | await servers[0].videos.removeWebVideoFile({ videoId: webVideoId, fileId: file.id }) |
128 | } | 128 | } |
129 | 129 | ||
130 | await waitJobs(servers) | 130 | await waitJobs(servers) |
131 | 131 | ||
132 | for (const server of servers) { | 132 | for (const server of servers) { |
133 | const video = await server.videos.get({ id: webtorrentId }) | 133 | const video = await server.videos.get({ id: webVideoId }) |
134 | 134 | ||
135 | expect(video.files).to.have.lengthOf(0) | 135 | expect(video.files).to.have.lengthOf(0) |
136 | } | 136 | } |
@@ -182,16 +182,16 @@ describe('Test videos files', function () { | |||
182 | it('Should not delete last file of a video', async function () { | 182 | it('Should not delete last file of a video', async function () { |
183 | this.timeout(60_000) | 183 | this.timeout(60_000) |
184 | 184 | ||
185 | const webtorrentOnly = await servers[0].videos.get({ id: hlsId }) | 185 | const webVideoOnly = await servers[0].videos.get({ id: hlsId }) |
186 | const hlsOnly = await servers[0].videos.get({ id: webtorrentId }) | 186 | const hlsOnly = await servers[0].videos.get({ id: webVideoId }) |
187 | 187 | ||
188 | for (let i = 0; i < 4; i++) { | 188 | for (let i = 0; i < 4; i++) { |
189 | await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentOnly.id, fileId: webtorrentOnly.files[i].id }) | 189 | await servers[0].videos.removeWebVideoFile({ videoId: webVideoOnly.id, fileId: webVideoOnly.files[i].id }) |
190 | await servers[0].videos.removeHLSFile({ videoId: hlsOnly.id, fileId: hlsOnly.streamingPlaylists[0].files[i].id }) | 190 | await servers[0].videos.removeHLSFile({ videoId: hlsOnly.id, fileId: hlsOnly.streamingPlaylists[0].files[i].id }) |
191 | } | 191 | } |
192 | 192 | ||
193 | const expectedStatus = HttpStatusCode.BAD_REQUEST_400 | 193 | const expectedStatus = HttpStatusCode.BAD_REQUEST_400 |
194 | await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentOnly.id, fileId: webtorrentOnly.files[4].id, expectedStatus }) | 194 | await servers[0].videos.removeWebVideoFile({ videoId: webVideoOnly.id, fileId: webVideoOnly.files[4].id, expectedStatus }) |
195 | await servers[0].videos.removeHLSFile({ videoId: hlsOnly.id, fileId: hlsOnly.streamingPlaylists[0].files[4].id, expectedStatus }) | 195 | await servers[0].videos.removeHLSFile({ videoId: hlsOnly.id, fileId: hlsOnly.streamingPlaylists[0].files[4].id, expectedStatus }) |
196 | }) | 196 | }) |
197 | }) | 197 | }) |