testing: cover diff viewer and logs console behavior#373
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdded new behavior contract tests for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/src/app/__tests__/widgetBehavior.contracts.test.ts`:
- Around line 910-912: The test declares the variable "text" with let but it is
only assigned once; change the declaration to const to satisfy
lint/style/useConst. Locate the two occurrences where text is created via
createTestRenderer(...).render(view()).toText() (around the tests using
createTestRenderer and view()) and replace let text with const text in both
places so the variable is immutable and CI/linter will pass.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 05c0ee60-7ef7-4bfd-a462-95830fe1bae2
📒 Files selected for processing (2)
packages/core/src/app/__tests__/widgetBehavior.contracts.test.tspackages/core/src/widgets/__tests__/editors.test.ts
💤 Files with no reviewable changes (1)
- packages/core/src/widgets/tests/editors.test.ts
| let text = createTestRenderer({ viewport: { cols: 28, rows: 6 } }) | ||
| .render(view()) | ||
| .toText(); |
There was a problem hiding this comment.
Use const for text to fix Biome and unblock CI.
On Line 910 and Line 959, text is declared with let but assigned only once in each test, which triggers lint/style/useConst.
Suggested patch
- let text = createTestRenderer({ viewport: { cols: 28, rows: 6 } })
+ const text = createTestRenderer({ viewport: { cols: 28, rows: 6 } })
.render(view())
.toText();
@@
- let text = createTestRenderer({ viewport: { cols: 28, rows: 6 } })
+ const text = createTestRenderer({ viewport: { cols: 28, rows: 6 } })
.render(view())
.toText();Also applies to: 959-961
🧰 Tools
🪛 GitHub Actions: ci
[error] 910-912: Biome lint/style/useConst: 'text' is never reassigned. This let declares a variable that is only assigned once. Safe fix: use const instead.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/core/src/app/__tests__/widgetBehavior.contracts.test.ts` around
lines 910 - 912, The test declares the variable "text" with let but it is only
assigned once; change the declaration to const to satisfy lint/style/useConst.
Locate the two occurrences where text is created via
createTestRenderer(...).render(view()).toText() (around the tests using
createTestRenderer and view()) and replace let text with const text in both
places so the variable is immutable and CI/linter will pass.
5327e21 to
f191e6d
Compare
Summary
Families Covered
Tests Added, Rewritten, Removed
packages/core/src/app/__tests__/widgetBehavior.contracts.test.tsfor diff viewer hover-wheel scroll and click focuspackages/core/src/widgets/__tests__/editors.test.tsfordiffViewerandlogsConsolebecause factory and smoke coverage already covered that surface and the new behavior tests now protect the visible contractImplementation Bugs Fixed
Commands Run
./node_modules/.bin/tsc -b packages/core/tsconfig.json --pretty falsenode --test packages/core/dist/app/__tests__/widgetBehavior.contracts.test.js packages/core/dist/app/__tests__/widgetRenderer.integration.test.js packages/core/dist/runtime/__tests__/wheelRouting.test.js packages/core/dist/widgets/__tests__/editors.test.js packages/core/dist/widgets/__tests__/vnode.factory.test.js packages/core/dist/widgets/__tests__/widgetRenderSmoke.test.jsUnresolved Areas Left Explicit
Dependency Note
Summary by CodeRabbit