diff options
Diffstat (limited to 'server/tests/api/videos/resumable-upload.ts')
-rw-r--r-- | server/tests/api/videos/resumable-upload.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.ts index 91eb61833..cac1201e9 100644 --- a/server/tests/api/videos/resumable-upload.ts +++ b/server/tests/api/videos/resumable-upload.ts | |||
@@ -11,6 +11,7 @@ import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServ | |||
11 | // Most classic resumable upload tests are done in other test suites | 11 | // Most classic resumable upload tests are done in other test suites |
12 | 12 | ||
13 | describe('Test resumable upload', function () { | 13 | describe('Test resumable upload', function () { |
14 | const path = '/api/v1/videos/upload-resumable' | ||
14 | const defaultFixture = 'video_short.mp4' | 15 | const defaultFixture = 'video_short.mp4' |
15 | let server: PeerTubeServer | 16 | let server: PeerTubeServer |
16 | let rootId: number | 17 | let rootId: number |
@@ -44,7 +45,7 @@ describe('Test resumable upload', function () { | |||
44 | 45 | ||
45 | const mimetype = 'video/mp4' | 46 | const mimetype = 'video/mp4' |
46 | 47 | ||
47 | const res = await server.videos.prepareResumableUpload({ token, attributes, size, mimetype, originalName, lastModified }) | 48 | const res = await server.videos.prepareResumableUpload({ path, token, attributes, size, mimetype, originalName, lastModified }) |
48 | 49 | ||
49 | return res.header['location'].split('?')[1] | 50 | return res.header['location'].split('?')[1] |
50 | } | 51 | } |
@@ -66,6 +67,7 @@ describe('Test resumable upload', function () { | |||
66 | 67 | ||
67 | return server.videos.sendResumableChunks({ | 68 | return server.videos.sendResumableChunks({ |
68 | token, | 69 | token, |
70 | path, | ||
69 | pathUploadId, | 71 | pathUploadId, |
70 | videoFilePath: absoluteFilePath, | 72 | videoFilePath: absoluteFilePath, |
71 | size, | 73 | size, |
@@ -125,7 +127,7 @@ describe('Test resumable upload', function () { | |||
125 | it('Should correctly delete files after an upload', async function () { | 127 | it('Should correctly delete files after an upload', async function () { |
126 | const uploadId = await prepareUpload() | 128 | const uploadId = await prepareUpload() |
127 | await sendChunks({ pathUploadId: uploadId }) | 129 | await sendChunks({ pathUploadId: uploadId }) |
128 | await server.videos.endResumableUpload({ pathUploadId: uploadId }) | 130 | await server.videos.endResumableUpload({ path, pathUploadId: uploadId }) |
129 | 131 | ||
130 | expect(await countResumableUploads()).to.equal(0) | 132 | expect(await countResumableUploads()).to.equal(0) |
131 | }) | 133 | }) |
@@ -251,7 +253,7 @@ describe('Test resumable upload', function () { | |||
251 | const uploadId1 = await prepareUpload({ originalName, lastModified, token: server.accessToken }) | 253 | const uploadId1 = await prepareUpload({ originalName, lastModified, token: server.accessToken }) |
252 | 254 | ||
253 | await sendChunks({ pathUploadId: uploadId1 }) | 255 | await sendChunks({ pathUploadId: uploadId1 }) |
254 | await server.videos.endResumableUpload({ pathUploadId: uploadId1 }) | 256 | await server.videos.endResumableUpload({ path, pathUploadId: uploadId1 }) |
255 | 257 | ||
256 | const uploadId2 = await prepareUpload({ originalName, lastModified, token: server.accessToken }) | 258 | const uploadId2 = await prepareUpload({ originalName, lastModified, token: server.accessToken }) |
257 | expect(uploadId1).to.equal(uploadId2) | 259 | expect(uploadId1).to.equal(uploadId2) |