mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 16:14:43 -04:00
fix(media-controller): throw if no file was uploaded
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
9d8d5e8d55
commit
b311265762
2 changed files with 13 additions and 2 deletions
|
@ -106,6 +106,13 @@ describe('Media', () => {
|
|||
.expect('Content-Type', /json/)
|
||||
.expect(500);
|
||||
});
|
||||
it('no media uploaded', async () => {
|
||||
await agent
|
||||
.post('/api/private/media')
|
||||
.set('HedgeDoc-Note', 'test_upload_media')
|
||||
.expect(400);
|
||||
await expect(fs.access(uploadPath)).rejects.toBeDefined();
|
||||
});
|
||||
afterEach(async () => {
|
||||
await ensureDeleted(uploadPath);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue