Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion frontend/src/components/modals/ExportModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ describe('ExportModal', () => {
);

expect(screen.getAllByText('먼저 테이블을 추가하세요')).toHaveLength(7);
expect(screen.getByRole('button', { name: 'SQL DDL 복사' })).toBeDisabled();
const sqlButton = screen.getByRole('button', { name: 'SQL DDL 복사' });
expect(sqlButton).toBeDisabled();
expect(sqlButton).toHaveAttribute('aria-describedby', 'export-artifact-desc-sql-ddl');

expect(screen.getByRole('button', { name: 'SVG 이미지 내보내기' })).toBeDisabled();
expect(screen.getByRole('button', { name: 'PlantUML 내보내기' })).toBeDisabled();
expect(screen.getByRole('button', { name: 'Mermaid 내보내기' })).toBeDisabled();
Expand Down
36 changes: 20 additions & 16 deletions frontend/src/components/modals/ExportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,23 +212,27 @@ export function ExportModal({
</p>

<div className="exportModal__artifactList">
{artifacts.map((artifact) => (
<div className="exportModal__artifactRow" key={artifact.label}>
<div>
<strong>{artifact.label}</strong>
<span>{artifact.description}</span>
{artifacts.map((artifact) => {
const descId = `export-artifact-desc-${artifact.label.replace(/\s+/g, '-').toLowerCase()}`;
return (
<div className="exportModal__artifactRow" key={artifact.label}>
<div>
<strong>{artifact.label}</strong>
<span id={descId}>{artifact.description}</span>
</div>
<button
type="button"
onClick={artifact.onExport}
disabled={artifact.disabled}
aria-label={artifact.ariaLabel}
aria-live={artifact.label === 'SQL DDL' ? 'polite' : undefined}
aria-describedby={descId}
>
{artifact.buttonLabel}
</button>
</div>
<button
type="button"
onClick={artifact.onExport}
disabled={artifact.disabled}
aria-label={artifact.ariaLabel}
aria-live={artifact.label === 'SQL DDL' ? 'polite' : undefined}
>
{artifact.buttonLabel}
</button>
</div>
))}
);
})}
</div>
</section>
</div>
Expand Down
Loading