From 0cef0ae2975466b5d682d47a3260b55e82e3aa52 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Sat, 17 Oct 2026 11:30:10 -0400 Subject: [PATCH] test(desktop): establish keyboard focus before saved-nest Enter Fix the focus-sensitive failure in HighlightedNestShowsItsPlatesAndDrawings_AndEnterOpensIt from GitHub run 39042902952. Explicitly focus the nest grid and assert it owns focus before sending Enter. Production keyboard handling and all existing open, cancel, and missing-archive assertions remain unchanged. --- OpenNest.WinForms.Tests/Forms/SavedNestsFormTests.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenNest.WinForms.Tests/Forms/SavedNestsFormTests.cs b/OpenNest.WinForms.Tests/Forms/SavedNestsFormTests.cs index fe3a4c5c..b0adbd80 100644 --- a/OpenNest.WinForms.Tests/Forms/SavedNestsFormTests.cs +++ b/OpenNest.WinForms.Tests/Forms/SavedNestsFormTests.cs @@ -48,6 +48,9 @@ public class SavedNestsFormTests "the second nest's plates"); Assert.Equal(1, drawings.Rows[0].Cells["Nested"].Value); + // Selecting a row does not guarantee keyboard focus after pumping UI events. + Assert.True(nests.Focus()); + Assert.True(nests.Focused); Assert.True(ProcessKey(form, Keys.Enter)); Assert.Equal(DialogResult.OK, form.DialogResult); Assert.Equal(second.Id, form.SelectedId);