Fix multi-image selection when mime type is missing
This commit is contained in:
@@ -147,4 +147,20 @@ describe('UploadScreen', () => {
|
||||
});
|
||||
expect(addToQueueMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('accepts image files with empty mime type when extension is valid', async () => {
|
||||
const { container } = render(
|
||||
<EventDataProvider token="token">
|
||||
<UploadScreen />
|
||||
</EventDataProvider>
|
||||
);
|
||||
|
||||
const input = container.querySelector('input[type="file"]') as HTMLInputElement;
|
||||
const file = new File(['rawdata'], 'from-library.jpg', { type: '' });
|
||||
|
||||
fireEvent.change(input, { target: { files: [file] } });
|
||||
|
||||
expect(await screen.findByLabelText('Remove photo')).toBeInTheDocument();
|
||||
expect(screen.getByText('{count} photos selected')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user