mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-12-02 20:19:26 -05:00
test(ui): start the grid tooltip timer the dispose test relies on
DisposingAGridStopsItsShowingKeyboardToolTip expected ShowKeyboardToolTip to leave an auto-pop timer running. On Windows 11 and later keyboard tooltips are persistent and start none, and showing one hooks the form's Deactivate, which stops the timer whenever the form loses activation (it flaked on CI's Server 2022 runner). Set up the running timer explicitly; the test still fails without GridStyle's dispose hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2773654604
commit
e78fc45149
1 file changed
+8
-1
@@ -94,10 +94,17 @@ public class GridStyleTests
|
||||
form.Show();
|
||||
Pump(grid);
|
||||
|
||||
// As when the keyboard moves to a cell in the embedded version history.
|
||||
// As when the keyboard moves to a cell in the embedded version history. On Windows 11
|
||||
// and later a keyboard tooltip is persistent and starts no timer, so make it behave as
|
||||
// it does on earlier Windows, where the timer exists.
|
||||
var toolTip = (ToolTip)typeof(DataGridView).GetProperty("KeyboardToolTip", members).GetValue(grid);
|
||||
typeof(ToolTip).GetProperty("IsPersistent", members).SetValue(toolTip, false);
|
||||
typeof(ToolTip).GetMethod("ShowKeyboardToolTip", members)
|
||||
.Invoke(toolTip, new object[] { "2", grid.Rows[0].Cells[0], 3000 });
|
||||
// Showing hooks the form's Deactivate, which hides the tip and stops its timer; losing
|
||||
// activation to another window (a parallel test's form) is not the case under test, so
|
||||
// make sure the auto-pop timer is running before the grid goes.
|
||||
typeof(ToolTip).GetMethod("StartTimer", members).Invoke(toolTip, new object[] { grid, 3000 });
|
||||
var timer = typeof(ToolTip).GetField("_timer", members);
|
||||
Assert.NotNull(timer.GetValue(toolTip));
|
||||
|
||||
|
||||
Reference in new issue
Block a user