mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-05 05:22:58 -05:00
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.
This commit is contained in:
1 parent
bde262814f
commit
96820e7c2b
1 file changed
+4
-2
@@ -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");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user