Skip to content

Commit

Permalink
test: update empty file upload test
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoenig134 committed Dec 19, 2024
1 parent 1607cc1 commit 49c00b9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ describe("File Upload", () => {
expect(response.result.byteLength).toBe(4);
});

test("cannot upload an empty file", async () => {
test("can upload an empty file", async () => {
const response = await client1.files.uploadOwnFile(await makeUploadRequest({ file: Buffer.of() }));
expect(response).toBeAnError("'content' is empty", "error.runtime.validation.invalidPropertyValue");
expect(response).toBeSuccessful(ValidationSchema.File);

const downloadResponse = await client1.files.downloadFile(response.result.id);
expect(downloadResponse.isSuccess).toBeTruthy();
expect(downloadResponse.result.byteLength).toBe(0);
});

test("cannot upload a file that is null", async () => {
Expand Down

0 comments on commit 49c00b9

Please sign in to comment.