diff --git a/apps/web/src/components/hq/HQSections.test.tsx b/apps/web/src/components/hq/HQSections.test.tsx index d090333..7d38423 100644 --- a/apps/web/src/components/hq/HQSections.test.tsx +++ b/apps/web/src/components/hq/HQSections.test.tsx @@ -17,7 +17,6 @@ vi.mock('@/lib/utils', () => ({ formatRelativeTime: () => '5 minutes ago', })) -import { HQWaitingForInputSection } from './HQWaitingForInputSection' import { HQNeedsReviewSection } from './HQNeedsReviewSection' import { HQNeedsApprovalSection } from './HQNeedsApprovalSection' import { HQResolvingConflictsSection } from './HQResolvingConflictsSection' @@ -26,115 +25,6 @@ import { HQEmptyState } from './HQEmptyState' const since = new Date(Date.now() - 5 * 60 * 1000).toISOString() -// ─── HQWaitingForInputSection ──────────────────────────────────────────────── - -describe('HQWaitingForInputSection', () => { - beforeEach(() => vi.clearAllMocks()) - - it('renders section heading "Waiting for Input"', () => { - render() - expect(screen.getByText('Waiting for Input')).toBeInTheDocument() - }) - - it('renders agent name and truncated question text', () => { - const longQuestion = 'A'.repeat(150) - render( - - ) - expect(screen.getByText('Agent Alpha')).toBeInTheDocument() - // Truncated to 120 chars + ellipsis - const truncated = 'A'.repeat(120) + '…' - expect(screen.getByText(truncated)).toBeInTheDocument() - // Full text in tooltip content (forceMount renders it into DOM) - expect(screen.getAllByText(longQuestion).length).toBeGreaterThanOrEqual(1) - }) - - it('renders "waiting X" relative time', () => { - render( - - ) - expect(screen.getByText('waiting 5 minutes ago')).toBeInTheDocument() - }) - - it('clicking "Answer" calls navigate to /inbox', () => { - render( - - ) - fireEvent.click(screen.getByRole('button', { name: /answer/i })) - expect(mockNavigate).toHaveBeenCalledWith({ to: '/inbox' }) - }) - - it('shows initiative name when non-null', () => { - render( - - ) - expect(screen.getByText(/My Initiative/)).toBeInTheDocument() - }) - - it('hides initiative name when null', () => { - render( - - ) - // No separator dot should appear since initiative is null - expect(screen.queryByText(/·/)).not.toBeInTheDocument() - }) -}) - // ─── HQNeedsReviewSection ──────────────────────────────────────────────────── describe('HQNeedsReviewSection', () => { diff --git a/vitest.config.ts b/vitest.config.ts index 4c6a261..66e7b01 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -5,14 +5,12 @@ import path from 'node:path'; export default defineConfig({ plugins: [react()], resolve: { - // Alias react to the parent monorepo's copy, matching what @testing-library - // loads react-dom from. This ensures React DOM and our components share the - // same ReactSharedInternals and hook dispatcher — preventing null-dispatcher - // errors when running tests from a git worktree. + // Ensure all React imports resolve to the same copy, preventing + // duplicate-React errors (mismatched ReactSharedInternals / hook dispatcher). alias: { '@': path.resolve(__dirname, './apps/web/src'), - react: path.resolve(__dirname, '../../../../node_modules/react'), - 'react-dom': path.resolve(__dirname, '../../../../node_modules/react-dom'), + react: path.resolve(__dirname, 'node_modules/react'), + 'react-dom': path.resolve(__dirname, 'node_modules/react-dom'), }, dedupe: ['react', 'react-dom'], },