mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-28 00:38:00 +01:00
Adds Label mouse click test
This commit is contained in:
@@ -51,6 +51,27 @@ public class LabelTests
|
||||
Assert.True (nextSubview.HasFocus);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MouseClick_SetsFocus_OnNextSubview ()
|
||||
{
|
||||
var superView = new View () { CanFocus = true, Height = 1, Width = 15};
|
||||
var focusedView = new View () { CanFocus = true, Width = 1, Height = 1 };
|
||||
var label = new Label () { X = 2, Title = "_x" };
|
||||
var nextSubview = new View () { CanFocus = true, X = 4, Width = 4, Height = 1 };
|
||||
superView.Add (label, nextSubview);
|
||||
superView.BeginInit ();
|
||||
superView.EndInit ();
|
||||
|
||||
Assert.False (focusedView.HasFocus);
|
||||
Assert.False (label.HasFocus);
|
||||
Assert.False (nextSubview.HasFocus);
|
||||
|
||||
label.OnMouseEvent (new MouseEvent () { X = 0, Y = 0, Flags = MouseFlags.Button1Clicked });
|
||||
Assert.False (label.HasFocus);
|
||||
Assert.True (nextSubview.HasFocus);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HotKey_Command_Does_Not_Accept ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user