test sweep: cover ui/ widget-level helpers (T-91)
Adds test/terminal/ui/ui_widget_test.dart — 14 widget tests covering the lib/src/terminal/src/ui/ helpers that need a Flutter widget tree (CustomKeyboardListener, KeyboardVisibilty, InfiniteScrollView, TerminalScrollGestureHandler). Files reaching ~100% (the 4 missing lines in infinite_scroll_view sit in the render-object's `position` setter, only triggered when Scrollable feeds a different ViewportOffset between rebuilds — not reachable through normal widget plumbing without internal access): - scroll_handler.dart: 0 / unmeasured → 39/39 (100%) — main-buffer passthrough vs. alt-buffer interception, mouse-mode forwarding vs. simulateScroll fallback, simulateScroll=false drop, alt-flip + didUpdateWidget rebinding, onPointerDown tracking the cursor for the next scroll event. - infinite_scroll_view.dart: 0 / unmeasured → 36/40 (90%) — onScroll fires on viewport position change, callback identity update via updateRenderObject. - keyboard_listener.dart: 7/12 → 12/12 (100%) — character-key fallthrough into onInsert when onKeyEvent returns ignored, short-circuit to onKeyEvent's "handled" return, no-op on a key with no character. - keyboard_visibility.dart: 18/19 → 19/19 (100%) — show + hide callbacks paired against view-insets transitions; no fire on same-inset metrics events. Coverage delta: - Total project: 68.80% → 69.12%; coverage_floor bumped 68 → 69. Tests use a `_host()` helper that wraps the widget under test in Directionality + MediaQuery + Center + a sized SizedBox. The TerminalScrollGestureHandler tests use ColoredBox as the child because Listener.onPointerSignal needs a hit-testable render object below it, and SizedBox.expand alone doesn't paint anything. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ repository: https://github.com/postmeridiem/clide
|
||||
|
||||
# Pre-push line-coverage floor. Ratchets up only — see D-66.
|
||||
# Reading: `awk -F: '/^coverage_floor:/ {gsub(/ /,"",$2); print $2}' pubspec.yaml`.
|
||||
coverage_floor: 68
|
||||
coverage_floor: 69
|
||||
|
||||
# Project metadata (was project.yaml, folded in per D-056).
|
||||
# version: above is the single source of truth. The Makefile reads
|
||||
|
||||
Reference in New Issue
Block a user