Extract upload dropzone and queue UI with shared pick validation utils.

This commit is contained in:
2026-10-20 22:20:16 +02:00
parent 3ab66c250c
commit d82d451448
12 changed files with 547 additions and 94 deletions
@@ -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');
});
});