Add field tracking tests for text input components#8
Merged
Conversation
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="tests/test-tracking.c">
<violation number="1" location="tests/test-tracking.c:507">
P2: The new focus-switching test bypasses the real focus logic by writing directly to ctx->focused_edit, so it cannot detect regressions in the behavior it claims to cover.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This adds new tests to prevent regression of focus/registration bugs in text input components: Registration tests: - test_search_bar_registers: verify search bar registers buffer - test_textfield_with_selection_registers: verify selection variant - test_search_view_registers: verify search modal registers query Focus persistence tests: - test_search_bar_focus_persists: focus maintained across frames - test_unregistered_field_loses_focus: negative test for tracking - test_focus_switch_between_fields: multi-field focus transfer via click State transition tests: - test_disabled_field_clears_focus: disabled clears focus - test_read_only_field_clears_focus: read_only clears focus - test_slider_unrendered_clears_active: slider state cleanup - test_rerender_after_skip_frame: conditional rendering behavior Stress test: - test_many_textfields_stress: 32 fields to test hash collisions These tests would have caught the bug fixed in commit 41c4b76 where text input components failed to register with field tracking system. All focus tests use real mouse input simulation to test actual focus handling logic, not direct state manipulation.
04ebbe8 to
44af8fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds new tests to prevent regression of focus/registration bugs in text input components:
Registration tests:
Focus persistence tests:
State transition tests:
Stress test:
Summary by cubic
Add tests for text input field tracking to prevent focus/registration regressions and verify state cleanup across frames. Expands coverage for search bar, textfield variants, search view, and slider active state.
Written for commit 44af8fe. Summary will update on new commits.