From ab9456e192548618012d1666ee195f32c49004c2 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Wed, 22 May 2024 15:47:21 +0530 Subject: [PATCH] chore: fix files e2e test [skip e2e] --- packages/snjs/mocha/lib/Files.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/snjs/mocha/lib/Files.js b/packages/snjs/mocha/lib/Files.js index b22683cf7..7692bb88b 100644 --- a/packages/snjs/mocha/lib/Files.js +++ b/packages/snjs/mocha/lib/Files.js @@ -1,3 +1,5 @@ +import * as Utils from './Utils.js' + export async function uploadFile(fileService, buffer, name, ext, chunkSize, vault, options = {}) { const byteLength = options.byteLengthOverwrite || buffer.byteLength const operation = await fileService.beginNewFileUpload(byteLength, vault) @@ -17,7 +19,9 @@ export async function uploadFile(fileService, buffer, name, ext, chunkSize, vaul } } - const file = await fileService.finishUpload(operation, name, ext) + const uuid = Utils.generateUuid() + + const file = await fileService.finishUpload(operation, { name, mimeType: ext }, uuid) return file }