Skip to content

testing: cover input and textarea focus behavior#369

Merged
RtlZeroMemory merged 1 commit intomainfrom
feature/testing-input-textarea-behavior
Apr 14, 2026
Merged

testing: cover input and textarea focus behavior#369
RtlZeroMemory merged 1 commit intomainfrom
feature/testing-input-textarea-behavior

Conversation

@RtlZeroMemory
Copy link
Copy Markdown
Owner

@RtlZeroMemory RtlZeroMemory commented Apr 14, 2026

Summary

  • cover input click-to-focus and blur-on-focus-loss behavior at the app contract level
  • cover readOnly textarea mouse focus and blur behavior without weakening the existing no-edit contract
  • keep the existing lower-level input editor, renderer integration, and semantic reference scenario coverage in place

Families Covered

  • input
  • textarea

Tests Added, Rewritten, Removed

  • added app-level tests in packages/core/src/app/__tests__/widgetBehavior.contracts.test.ts for input click focus, blur on focus loss, and readOnly textarea pointer focus
  • rewrote no existing tests in this PR
  • removed no tests in this PR because the retained lower-level suites still protect distinct editor and shared-scenario contracts

Implementation Bugs Fixed

  • none; the behavior-first tests passed once added

Commands Run

  • ./node_modules/.bin/tsc -b packages/core/tsconfig.json --pretty false
  • node --test packages/core/dist/app/__tests__/widgetBehavior.contracts.test.js packages/core/dist/app/__tests__/widgetRenderer.integration.test.js packages/core/dist/runtime/__tests__/inputEditor.contract.test.js packages/core/dist/testing/__tests__/referenceScenario.semantic.test.js

Unresolved Areas Left Explicit

  • broader modal, overlay, and focus ownership behavior is handled separately
  • table, virtual list, tree, and select/dropdown behavior remain in separate follow-up PRs
  • cursor normalization across semantic and PTY paths is still out of scope here

Dependency Note

  • none

#Closes 344

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

📝 Walkthrough

Walkthrough

Two new contract tests were added to validate focus/blur and edit behavior for input-like widgets. The tests verify correct focus movement, event emission on text input, blur event firing on focus loss, and suppression of edit actions in read-only textareas.

Changes

Cohort / File(s) Summary
Widget Behavior Contract Tests
packages/core/src/app/__tests__/widgetBehavior.contracts.test.ts
Added two contract tests: one verifying ui.input focus/blur interactions and edit action emission; another validating readOnly ui.textarea accepts focus but suppresses edit actions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Click, focus, blur—oh what delight!
Input widgets dancing left and right,
Read-only textareas stand their ground,
While contracts test each focus sound! 🎯

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'testing: cover input and textarea focus behavior' directly and clearly summarizes the main change: adding test coverage for focus behavior of input and textarea widgets.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/testing-input-textarea-behavior

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@RtlZeroMemory RtlZeroMemory merged commit 22a8b54 into main Apr 14, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant