Extract upload dropzone and queue UI with shared pick validation utils.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { buildPickedUploadWarning } from '@/utils/upload/buildPickedUploadWarning';
|
||||
|
||||
describe('buildPickedUploadWarning', () => {
|
||||
it('returns null when nothing was skipped', () => {
|
||||
expect(
|
||||
buildPickedUploadWarning(
|
||||
{ nonImageCount: 0, oversizedImagesCount: 0, queueOmittedImagesCount: 0 },
|
||||
5
|
||||
)
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it('joins skip reasons into one message', () => {
|
||||
const message = buildPickedUploadWarning(
|
||||
{ nonImageCount: 1, oversizedImagesCount: 2, queueOmittedImagesCount: 3 },
|
||||
4
|
||||
);
|
||||
|
||||
expect(message).toContain('1 non-image');
|
||||
expect(message).toContain('2 image(s) exceeded');
|
||||
expect(message).toContain('first 4 valid images');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user