mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
WIP: try to get context menu to work properly in automation tests
This commit is contained in:
@@ -37,6 +37,30 @@ public class BasicFluentAssertionTests
|
||||
.ResizeConsole (20,20)
|
||||
.Assert (lbl.Frame.Width.Should ().Be (18))
|
||||
.Stop ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ContextMenu_CrashesOnRight ()
|
||||
{
|
||||
var clicked = false;
|
||||
|
||||
var ctx = new ContextMenu ();
|
||||
var menuItems = new MenuBarItem (
|
||||
[
|
||||
new ("_New File", string.Empty, () => { clicked = true; })
|
||||
]
|
||||
);
|
||||
|
||||
using var c = With.A<Window> (40, 10)
|
||||
.WithContextMenu(ctx,menuItems)
|
||||
// Click in main area inside border
|
||||
.RightClick(1,1)
|
||||
.LeftClick (2, 2)
|
||||
/*.Assert (Application.Top.Focused.Should ().BeAssignableTo(typeof(MenuBarItem)))
|
||||
.Down()
|
||||
.Enter()*/
|
||||
.Stop ();
|
||||
Assert.True (clicked);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user