Skip to content

Commit

Permalink
Add failing test for #8638.
Browse files Browse the repository at this point in the history
  • Loading branch information
grokys committed Nov 10, 2023
1 parent 9cd8dda commit 6e4729f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/Avalonia.Controls.UnitTests/ToolTipTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,36 @@ public void Should_Close_On_Null_Tip()
Assert.False(ToolTip.GetIsOpen(target));
}
}

[Fact]
public void Should_Not_Close_When_Pointer_Is_Moved_Over_ToolTip()
{
using (UnitTestApplication.Start(TestServices.StyledWindow))
{
var window = new Window();

var target = new Decorator()
{
[ToolTip.TipProperty] = "Tip",
[ToolTip.ShowDelayProperty] = 0
};

window.Content = target;

window.ApplyStyling();
window.ApplyTemplate();
window.Presenter.ApplyTemplate();

_mouseHelper.Enter(target);
Assert.True(ToolTip.GetIsOpen(target));

var tooltip = Assert.IsType<ToolTip>(target.GetValue(ToolTip.ToolTipProperty));
_mouseHelper.Enter(tooltip);
_mouseHelper.Leave(target);

Assert.True(ToolTip.GetIsOpen(target));
}
}
}

internal class ToolTipViewModel
Expand Down

0 comments on commit 6e4729f

Please sign in to comment.