import { readFileSync } from 'node:fs'; import { describe, expect, it } from 'vitest'; describe('import preview layout', () => { it('renders duplicate guidance as unboxed wrapping prose without horizontal scrolling', () => { const dialog = readFileSync('src/features/import-workflow/ImportWorkflowDialog.tsx', 'utf8'); const styles = readFileSync('src/styles/import-workflow.css', 'utf8'); expect(dialog).toContain("reimport ? 'Expected replacement source' : 'Duplicate found'"); expect(dialog).toContain("reimport ? 'Replacement source rejected' : 'Duplicate found'"); expect(dialog).toContain('A safe reimport requires byte-identical source files and has been blocked.'); expect(dialog).toContain("expectedReplacement ? 'Expected replacement source' : statusLabels[entry.status]"); expect(dialog).toContain("reimport ? 'Reimport and replace' : 'Import selection'"); expect(dialog).toContain('Matching the existing scan is correct in this workflow.'); expect(styles).toContain('overflow-x: hidden'); expect(styles).toContain('.import-preview-entry { display: grid; grid-template-columns: 28px minmax(0, 1fr);'); expect(styles).not.toMatch(/\.import-preview-entry \{[^}]*border:\s*1px/); expect(styles).not.toMatch(/\.import-preview-entry \{[^}]*background:/); expect(styles).toContain('.import-duplicate-notice p { margin: 0;'); expect(styles).toContain('.import-status-replacement { color: var(--low); }'); expect(styles).toContain('.import-replacement-notice h3'); }); });