Skip to content

Commit 607bd66

Browse files
committed
test(tui): expect immediate side pane mouse scroll drain
1 parent 9b8f4dd commit 607bd66

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

src/tui/app/tests/state_model_poke_01/part_01.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ fn test_mouse_scroll_over_diff_pane_scrolls_side_panel_without_changing_focus()
845845
modifiers: KeyModifiers::empty(),
846846
});
847847

848-
assert_eq!(app.diff_pane_scroll, 6);
848+
assert_eq!(app.diff_pane_scroll, 8);
849849
assert!(!app.diff_pane_focus);
850850
assert!(!app.diff_pane_auto_scroll);
851851
}
@@ -872,15 +872,18 @@ fn test_mouse_scroll_animation_preserves_side_pane_scroll_sensitivity() {
872872
modifiers: KeyModifiers::empty(),
873873
});
874874

875-
assert_eq!(app.diff_pane_scroll, 6, "first frame should move one line");
875+
assert_eq!(
876+
app.diff_pane_scroll, 8,
877+
"one wheel notch should drain the full side-pane scroll amount"
878+
);
876879

877880
let _ = crate::tui::app::local::handle_tick(&mut app);
878-
assert_eq!(app.diff_pane_scroll, 7);
881+
assert_eq!(app.diff_pane_scroll, 8);
879882

880883
crate::tui::app::local::handle_tick(&mut app);
881884
assert_eq!(
882885
app.diff_pane_scroll, 8,
883-
"one wheel notch should still total three lines"
886+
"ticks should not add extra scroll after the wheel notch drained"
884887
);
885888
}
886889

@@ -923,7 +926,7 @@ fn test_mouse_scroll_over_tool_side_panel_scrolls_shared_right_pane_without_chan
923926
!scroll_only,
924927
"side-panel wheel scroll should request an immediate redraw"
925928
);
926-
assert_eq!(app.diff_pane_scroll, 6);
929+
assert_eq!(app.diff_pane_scroll, 8);
927930
assert!(!app.diff_pane_focus);
928931
assert!(!app.diff_pane_auto_scroll);
929932
}

src/tui/app/tests/state_model_poke_01/part_02.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,16 @@ fn test_mouse_scroll_over_tool_side_panel_updates_visible_render() {
8484
row: diff_area.y + diff_area.height.saturating_sub(2).min(3),
8585
modifiers: KeyModifiers::empty(),
8686
});
87-
assert_eq!(app.diff_pane_scroll, 1);
87+
assert_eq!(app.diff_pane_scroll, 3);
8888

8989
let after = render_and_snap(&app, &mut terminal);
90-
assert_eq!(crate::tui::ui::last_diff_pane_effective_scroll(), 1);
90+
assert_eq!(crate::tui::ui::last_diff_pane_effective_scroll(), 3);
9191
assert_ne!(
9292
before, after,
9393
"hover scrolling should repaint the side panel"
9494
);
95-
assert!(after.contains("side-scroll-02"));
96-
assert!(after.contains("side-scroll-03"));
95+
assert!(after.contains("side-scroll-04"));
96+
assert!(after.contains("side-scroll-05"));
9797
assert!(!after.contains("side-scroll-01"));
9898
}
9999

0 commit comments

Comments
 (0)