mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Make all media be uploaded with a unique hash
This commit is contained in:
parent
be6b692a7b
commit
8ecdc6261e
4 changed files with 37 additions and 28 deletions
|
|
@ -148,7 +148,7 @@ describe("S3MediaBackend", () => {
|
|||
expect(result.uploadedFile).toEqual(mockFile);
|
||||
expect(result.hash).toHaveLength(64);
|
||||
expect(mockS3Client.putObject).toHaveBeenCalledWith(
|
||||
mockFile.name,
|
||||
expect.stringContaining(mockFile.name),
|
||||
expect.any(ReadableStream),
|
||||
{ size: mockFile.size },
|
||||
);
|
||||
|
|
@ -236,7 +236,7 @@ describe("LocalMediaBackend", () => {
|
|||
const result = await localMediaBackend.addFile(mockFile);
|
||||
|
||||
expect(result.uploadedFile).toEqual(mockFile);
|
||||
expect(result.path).toEqual("./uploads/megamind.png");
|
||||
expect(result.path).toEqual(expect.stringContaining("megamind.png"));
|
||||
expect(result.hash).toHaveLength(64);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue