mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-19 06:55:59 +01:00
fix: nothing under the mouse is silent: dividers, previews, class pictures, categories
A page swept point by point left a few places a reader heard nothing: the panel dividers, the vehicle preview in the depot and the texture base, the picture by a vehicle class and the empty part of the settings categories. Each now has a name; a picture with a caption beside it reads as the caption. The tests that build controls run one after another: a control belongs to the thread that made the first one, and side by side they now and then failed.
This commit is contained in:
@@ -6,6 +6,7 @@ using StarterNG.Controls;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
[Collection(AvaloniaControls.Name)]
|
||||
public class AnnouncerTests
|
||||
{
|
||||
private DateTime _now = new(2026, 11, 15, 12, 0, 0, DateTimeKind.Utc);
|
||||
@@ -81,6 +82,7 @@ public class AnnouncerTests
|
||||
}
|
||||
}
|
||||
|
||||
[Collection(AvaloniaControls.Name)]
|
||||
public class NamedGroupTests
|
||||
{
|
||||
static NamedGroupTests() => ScreenReaderNames.Install();
|
||||
|
||||
11
StarterNG.Tests/AvaloniaControls.cs
Normal file
11
StarterNG.Tests/AvaloniaControls.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Tests that build Avalonia controls run one after another: a control belongs to the
|
||||
/// thread that made the first one, and run side by side they now and then failed.
|
||||
/// </summary>
|
||||
[CollectionDefinition(Name)]
|
||||
public sealed class AvaloniaControls
|
||||
{
|
||||
public const string Name = "Avalonia controls";
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using StarterNG.Controls;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
[Collection(AvaloniaControls.Name)]
|
||||
public class ExpandableTreeViewItemTests
|
||||
{
|
||||
private static IExpandCollapseProvider Peer(ExpandableTreeViewItem item) =>
|
||||
|
||||
@@ -4,6 +4,7 @@ using StarterNG.Controls;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
[Collection(AvaloniaControls.Name)]
|
||||
public class FieldLabelTests
|
||||
{
|
||||
static FieldLabelTests() => ScreenReaderNames.Install();
|
||||
|
||||
@@ -4,6 +4,7 @@ using StarterNG.Controls;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
[Collection(AvaloniaControls.Name)]
|
||||
public class KeyboardFocusTests
|
||||
{
|
||||
private readonly Button _window = new();
|
||||
|
||||
@@ -5,6 +5,7 @@ using StarterNG.Infrastructure;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
[Collection(AvaloniaControls.Name)]
|
||||
public class MouseReadingTests
|
||||
{
|
||||
static MouseReadingTests() => ScreenReaderNames.Install();
|
||||
@@ -20,6 +21,18 @@ public class MouseReadingTests
|
||||
Assert.Same(button, AutomationProperties.GetLabeledBy(logo));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_picture_beside_a_caption_is_read_as_the_caption()
|
||||
{
|
||||
var mini = new Image();
|
||||
var caption = new TextBlock { Text = "EU07" };
|
||||
_ = new StackPanel { Children = { mini, new TextBlock { IsVisible = false, Text = "ukryte" }, caption } };
|
||||
|
||||
ScreenReaderNames.NamePicture(mini);
|
||||
|
||||
Assert.Same(caption, AutomationProperties.GetLabeledBy(mini));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_picture_in_a_card_is_read_as_the_card_tooltip()
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ using StarterNG.Controls;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
[Collection(AvaloniaControls.Name)]
|
||||
public class ReadableSliderTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -6,6 +6,7 @@ using StarterNG.Controls;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
[Collection(AvaloniaControls.Name)]
|
||||
public class ScreenReaderNamesTests
|
||||
{
|
||||
static ScreenReaderNamesTests() => ScreenReaderNames.Install();
|
||||
@@ -188,6 +189,7 @@ public class ScreenReaderNamesTests
|
||||
}
|
||||
}
|
||||
|
||||
[Collection(AvaloniaControls.Name)]
|
||||
public class PickerNameTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user