[keyboard_detection] Add regression integration tests#1042
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds 18 integration test cases to the keyboard detection package, organizing them into groups covering state reporting, stateAsBool, keyboard metrics, notifications, registered callbacks, and lifecycle. Feedback suggests improving the test for ignoring invalid events by transitioning to a known state first to verify they are truly ignored, and removing redundant await tester.pump(); calls in the callback tests.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
9b3c6ca to
db0cb00
Compare
| group('stateAsBool', () { | ||
| testWidgets('maps the transitional visibling state', | ||
| (WidgetTester tester) async { | ||
| final KeyboardDetectionController controller = | ||
| KeyboardDetectionController(); | ||
| await emit(tester, <String, Object?>{'state': 'will_show'}); | ||
| await tester.pump(); | ||
| expect(controller.stateAsBool(), isFalse); | ||
| expect(controller.stateAsBool(true), isTrue); | ||
| await controller.dispose(); | ||
| }); |
There was a problem hiding this comment.
This is similar to the "reports visibling on will_show event" test.
Since it verifies the values of each data point for the "will_show" state, I believe it can be integrated into a one test.
Please combine similar tests into one. They are essentially duplicate tests.
Expand the integration test suite for the keyboard detection controller from 2 to 20 cases, driving the input-panel event channel with simulated platform messages so the tests are deterministic and need no real keyboard: - Initial unknown state and unknown fallback for unrecognized events. - All keyboard states: visibling, visible, hiding, hidden. - stateAsBool mapping, including the transitional states with and without includeTransitionalState. - Keyboard metrics (width, height/size, position) updates on show with dimensions, reset on hide, and isSizeLoaded / ensureSizeLoaded. - Robustness against malformed events (non-map / missing or wrong-typed state). - Notifications via the state stream and the onChanged callback. - Registered callbacks: delivery, self-unregister on returning false, unregisterCallback and unregisterAllCallbacks. - No further state changes are reported after dispose. This is a Tizen-exclusive plugin with no upstream package. Test-only change, recorded under a NEXT changelog entry without a version bump. Validated on a Raspberry Pi 4 (Tizen) device: 20 passed, 0 failed.
…ing tests Merge the stateAsBool group into the existing will_show and will_hide state reporting tests, which already cover the same event setup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
db0cb00 to
7fd41e2
Compare
Expand the integration test suite for the keyboard detection controller from 2 to 20 cases, driving the input-panel event channel with simulated platform messages so the tests are deterministic and need no real keyboard:
This is a Tizen-exclusive plugin with no upstream package. Test-only change, recorded under a NEXT changelog entry without a version bump. Validated on a Raspberry Pi 4 (Tizen) device: 20 passed, 0 failed.