using Avalonia.Controls; using Avalonia.Headless.XUnit; using Avalonia.VisualTree; using JdeScoping.ConfigManager.Views.Dialogs; namespace JdeScoping.ConfigManager.Tests.Views.Dialogs; /// /// UI tests for dialog views. /// public class DialogViewTests { /// /// Verifies that NewStoreDialog renders with the expected input fields. /// [AvaloniaFact] public void NewStoreDialogView_RendersInputFields() { // Arrange & Act var dialog = new NewStoreDialog(); dialog.Show(); // Assert - NewStoreDialog contains TextBoxes for store path and key file path var textBoxes = dialog.GetVisualDescendants().OfType().ToList(); textBoxes.Count.ShouldBeGreaterThanOrEqualTo(2); // Store path and Key file path // Verify section headers var textBlocks = dialog.GetVisualDescendants().OfType().ToList(); textBlocks.Any(tb => tb.Text == "Store Location").ShouldBeTrue(); textBlocks.Any(tb => tb.Text == "Key File").ShouldBeTrue(); } /// /// Verifies that NewStoreDialog has Browse and Generate buttons for key file. /// [AvaloniaFact] public void NewStoreDialogView_HasBrowseAndGenerateButtons() { // Arrange & Act var dialog = new NewStoreDialog(); dialog.Show(); // Assert var buttons = dialog.GetVisualDescendants().OfType