From 17bc907415e257e05c4a230769487f0f8ff56f6a Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Thu, 18 Jun 2026 23:21:06 +0200 Subject: [PATCH] fix(test): settle the menu overlay before re-tapping the top button The "tapping the same top button toggles closed" case re-tapped File before the open overlay finished laying out, so getCenter intermittently threw on a not-yet-positioned hit box under load. Settle first. Co-Authored-By: Claude Opus 4.8 (1M context) --- test/builtin/menubar/menu_bar_test.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/builtin/menubar/menu_bar_test.dart b/test/builtin/menubar/menu_bar_test.dart index 972ea07c..3d5fe1fe 100644 --- a/test/builtin/menubar/menu_bar_test.dart +++ b/test/builtin/menubar/menu_bar_test.dart @@ -99,6 +99,9 @@ void main() { await tester.pump(); await openMenu(tester, 'File'); expect(find.text('Open Folder…'), findsOneWidget); + // Let the open overlay finish laying out before re-tapping the top button, + // so its hit-test box is stable under load (getCenter would otherwise throw). + await tester.pumpAndSettle(); await tester.tap(find.text('File')); await tester.pump(); await tester.pump(const Duration(milliseconds: 20)); // flush the close under load