test: add unit tests for PanelRenderer module - #688
Conversation
69 tests covering: - Module exports (BOX constants, STATUS indicators) - Constructor and default/custom options - Box drawing primitives (horizontalLine, topBorder, bottomBorder, separator) - Content line rendering with ANSI-aware padding - ANSI stripping for length calculations - Elapsed time formatting (seconds, minutes, hours) - Pipeline rendering (stages, progress, completion markers) - Minimal mode panel (agent info, terminals, errors, elapsed) - Detailed mode panel (tradeoffs, next steps, PID display, reasons) - Edge cases: empty arrays, null agent IDs, long error truncation, terminal limits
- Move FORCE_COLOR para beforeAll/afterAll (evita leak entre workers) - Troca \x1B por \u001B no regex (compatibilidade Biome) - Divide teste de elapsed em 2 casos distintos (null vs 0) - Adiciona asserção para result.story
Corrige aviso do Biome lint usando Unicode escape consistente nas strings ANSI dos testes stripAnsi.
- Use RegExp constructor for ANSI regex (avoids Biome lint/suspicious/noControlCharactersInRegex) - Remove duplicate null-timestamp test (lines 252-258 duplicated lines 218-224)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis pull request adds a comprehensive Jest test suite for the ChangesPanelRenderer Test Suite
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Coverage ReportCoverage report not available
Generated by PR Automation (Story 6.1) |
Summary
maininSynkraAI/aiox-core..aios-coreimport with current.aiox-coreresolution from the repository root.no-control-regexlint warning by constructing the ANSI escape regex without embedding a control character.Validation
npm test -- tests/core/ui/panel-renderer.test.js --runInBand --forceExitnpm run lint(passes with the existing 114 warnings, 0 errors)npm run typecheckgit diff --check origin/main...HEAD && git diff --checkSupersedes #501.
Summary by CodeRabbit