Browse Source

Updated render test

pull/21226/head
Javier Suárez Ruiz 4 months ago
parent
commit
7f0f62141a
  1. 15
      tests/Avalonia.RenderTests/Controls/CommandBarTests.cs
  2. BIN
      tests/TestFiles/Skia/Controls/CommandBar/CommandBarButton_Overflow_ShowsLabel_WhenCompact.expected.png

15
tests/Avalonia.RenderTests/Controls/CommandBarTests.cs

@ -25,6 +25,16 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
Setters = { new Setter(TextBlock.FontFamilyProperty, TestFontFamily) }
};
private static Style OverflowLabelRectStyle => new Style(x => x.OfType<CommandBarButton>().Template().Name("PART_Label"))
{
Setters =
{
new Setter(TextBlock.WidthProperty, 50d),
new Setter(TextBlock.HeightProperty, 10d),
new Setter(TextBlock.BackgroundProperty, Brushes.Black),
}
};
[Fact]
public async Task CommandBar_Default_PrimaryCommands()
{
@ -156,8 +166,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
Padding = new Thickness(4),
Child = new CommandBarButton
{
Label = "Open",
FontFamily = TestFontFamily,
Label = string.Empty,
IsCompact = true,
IsInOverflow = true,
LabelPosition = CommandBarDefaultLabelPosition.Right,
@ -175,8 +184,10 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
target.Styles.Add(new SimpleTheme());
target.Styles.Add(FontStyle);
target.Styles.Add(OverflowLabelRectStyle);
await RenderToFile(target);
CompareImages(skipImmediate: true);
}
}
}

BIN
tests/TestFiles/Skia/Controls/CommandBar/CommandBarButton_Overflow_ShowsLabel_WhenCompact.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1008 B

After

Width:  |  Height:  |  Size: 427 B

Loading…
Cancel
Save