diff --git a/tests/Avalonia.LeakTests/ControlTests.cs b/tests/Avalonia.LeakTests/ControlTests.cs index 4433e25c5a..59cc023509 100644 --- a/tests/Avalonia.LeakTests/ControlTests.cs +++ b/tests/Avalonia.LeakTests/ControlTests.cs @@ -713,6 +713,10 @@ namespace Avalonia.LeakTests { using (Start()) { + // Height of ListBoxItem content + padding. + const double ListBoxItemHeight = 12; + const double TextBoxHeight = 25; + var items = new ObservableCollection(Enumerable.Range(0, 10)); NameScope ns; TextBox tb; @@ -721,8 +725,8 @@ namespace Avalonia.LeakTests { [NameScope.NameScopeProperty] = ns = new NameScope(), Width = 100, - Height = 100, - Content = new StackPanel + Height = (items.Count * ListBoxItemHeight) + TextBoxHeight, + Content = new DockPanel { Children = { @@ -730,6 +734,8 @@ namespace Avalonia.LeakTests { Name = "tb", Text = "foo", + Height = TextBoxHeight, + [DockPanel.DockProperty] = Dock.Top, }), (lb = new ListBox { @@ -745,7 +751,8 @@ namespace Avalonia.LeakTests Path = "Text", NameScope = new WeakReference(ns), } - }) + }), + Padding = new Thickness(0), }), } }