diff --git a/crates/engine/src/tests/fill_area.rs b/crates/engine/src/tests/fill_area.rs index 98c5dc34db..aebf2323a4 100644 --- a/crates/engine/src/tests/fill_area.rs +++ b/crates/engine/src/tests/fill_area.rs @@ -497,10 +497,13 @@ fn fill_area_tool_hovers_a_large_document_on_another_thread() { s.pointer(&PointerEvent::new(PointerKind::Move, 300.0, 300.0), v).unwrap(); s.tool_poll(v, true).unwrap(); assert_eq!(s.overlays(v).len(), 1); - // A click while a search runs waits for it. - s.pointer(&PointerEvent::new(PointerKind::Move, 310.0, 300.0), v).unwrap(); + // A click while a search runs waits for it: the pointer leaves the area, which starts a + // search, and the press inside the area comes before any poll. + s.pointer(&PointerEvent::new(PointerKind::Move, 500.0, 500.0), v).unwrap(); + assert!(s.tool_waiting()); let undo = undo_len(&s); s.pointer(&PointerEvent::new(PointerKind::Down, 310.0, 300.0), v).unwrap(); + assert!(!s.tool_waiting(), "the press waited for the search"); s.pointer(&PointerEvent::new(PointerKind::Up, 310.0, 300.0), v).unwrap(); assert_eq!(undo_len(&s), undo + 1); }