aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-06-01 10:43:36 +0200
committerChocobozzz <me@florianbigard.com>2023-06-29 09:49:06 +0200
commit1fb7d094229acdc190c3f7551b43ac5445814dee (patch)
tree46cb0d43d450ac5320bfaae2ee5e2d03b6ae9dbc /server/tests
parent866c5f667da9fc09f3b093ff0a6f89d4af0ce5af (diff)
downloadPeerTube-1fb7d094229acdc190c3f7551b43ac5445814dee.tar.gz
PeerTube-1fb7d094229acdc190c3f7551b43ac5445814dee.tar.zst
PeerTube-1fb7d094229acdc190c3f7551b43ac5445814dee.zip
Don't cache upload after video deletion
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/videos/resumable-upload.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.ts
index 2fbefb392..9de622281 100644
--- a/server/tests/api/videos/resumable-upload.ts
+++ b/server/tests/api/videos/resumable-upload.ts
@@ -254,6 +254,24 @@ describe('Test resumable upload', function () {
254 expect(result2.headers['x-resumable-upload-cached']).to.not.exist 254 expect(result2.headers['x-resumable-upload-cached']).to.not.exist
255 }) 255 })
256 256
257 it('Should not cache after video deletion', async function () {
258 const originalName = 'toto.mp4'
259 const lastModified = new Date().getTime()
260
261 const uploadId1 = await prepareUpload({ originalName, lastModified })
262 const result1 = await sendChunks({ pathUploadId: uploadId1 })
263 await server.videos.remove({ id: result1.body.video.uuid })
264
265 const uploadId2 = await prepareUpload({ originalName, lastModified })
266 const result2 = await sendChunks({ pathUploadId: uploadId2 })
267 expect(result1.body.video.uuid).to.not.equal(result2.body.video.uuid)
268
269 expect(result2.headers['x-resumable-upload-cached']).to.not.exist
270
271 await checkFileSize(uploadId1, null)
272 await checkFileSize(uploadId2, null)
273 })
274
257 it('Should refuse an invalid digest', async function () { 275 it('Should refuse an invalid digest', async function () {
258 const uploadId = await prepareUpload({ token: server.accessToken }) 276 const uploadId = await prepareUpload({ token: server.accessToken })
259 277