mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-10 05:37:29 +03:00
Add documentation to the new test
This commit is contained in:
parent
a99ee5e599
commit
80852c3e18
@ -598,20 +598,30 @@ mod test {
|
||||
div().h(px(10.)).w_full().into_any()
|
||||
});
|
||||
|
||||
// Ensure that the list is scrolled to the top
|
||||
state.scroll_to(gpui::ListOffset {
|
||||
item_ix: 0,
|
||||
offset_in_item: px(0.0),
|
||||
});
|
||||
|
||||
// Paint
|
||||
cx.draw(
|
||||
point(px(0.), px(0.)),
|
||||
size(px(100.), px(20.)).into(),
|
||||
|_| list(state.clone()).w_full().h_full().z_index(10).into_any(),
|
||||
);
|
||||
|
||||
// Reset
|
||||
state.reset(5);
|
||||
|
||||
// And then recieve a scroll event _before_ the next paint
|
||||
cx.simulate_event(ScrollWheelEvent {
|
||||
position: point(px(1.), px(1.)),
|
||||
delta: ScrollDelta::Pixels(point(px(0.), px(-500.))),
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
// Scroll position should stay at the top of the list
|
||||
assert_eq!(state.logical_scroll_top().item_ix, 0);
|
||||
assert_eq!(state.logical_scroll_top().offset_in_item, px(0.));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user