fix web design files upload picker (#199)

This commit is contained in:
Sid 2026-05-01 17:28:14 +08:00 committed by GitHub
parent 59e4966dda
commit 9969003aa5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,22 @@
import { renderToStaticMarkup } from 'react-dom/server';
import { describe, expect, it, vi } from 'vitest';
import { FileWorkspace } from './FileWorkspace';
describe('FileWorkspace upload input', () => {
it('keeps the Design Files picker aligned with drag-and-drop file support', () => {
const markup = renderToStaticMarkup(
<FileWorkspace
projectId="project-1"
files={[]}
onRefreshFiles={vi.fn()}
isDeck={false}
tabsState={{ tabs: [], active: null }}
onTabsStateChange={vi.fn()}
/>,
);
expect(markup).toContain('data-testid="design-files-upload-input"');
expect(markup).not.toContain('accept=');
});
});

View file

@ -415,7 +415,6 @@ export function FileWorkspace({
type="file"
multiple
data-testid="design-files-upload-input"
accept="image/*"
style={{ display: 'none' }}
onChange={handleFilePicked}
/>