From 96820e7c2b2beb6890a25406e50e610706d9d4cf Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 2 Dec 2026 15:56:31 -0800 Subject: [PATCH] Tests: the Quick Pen toolbar drag test checks where the toolbar ends up The test-lint step failed on this branch because renaming the handle to "Move Toolbar" put the_toolbar_stays_while_its_handle_drags_far in the changed lines, and its assertions only checked that the toolbar existed. The test now checks that after the release the toolbar keeps its size and has moved. --- crates/ui-egui/src/tests/quickpenbar.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/tests/quickpenbar.rs b/crates/ui-egui/src/tests/quickpenbar.rs index 08e432ab1c..841cc76d18 100644 --- a/crates/ui-egui/src/tests/quickpenbar.rs +++ b/crates/ui-egui/src/tests/quickpenbar.rs @@ -251,7 +251,7 @@ fn the_toolbar_goes_to_the_other_side_where_it_runs_off_the_canvas() { fn the_toolbar_stays_while_its_handle_drags_far() { let mut app = app(); on_canvas(&mut app, |rig| { - assert!(bar(rig).is_some()); + let before = bar(rig).expect("the toolbar is shown"); let grip = rig.target("Move Toolbar").expect("the toolbar's handle"); rig.fx.press(&grip); let from = grip.center(); @@ -260,7 +260,9 @@ fn the_toolbar_stays_while_its_handle_drags_far() { assert!(rig.fx.by_label(BAR).is_some(), "shown at step {k}"); } rig.fx.release_at(from + vec2(-120.0, -180.0)); - assert!(bar(rig).is_some()); + let after = bar(rig).expect("the toolbar stays after the release"); + assert_eq!(after.size(), before.size(), "the drag keeps the toolbar's size"); + assert_ne!(after.min, before.min, "the drag moved the toolbar"); }); }