Add comprehensive tests for EditSection functionality in the Windows application

- Implement tests for picker behavior, including loading sequences, searching, and handling empty libraries.
- Validate sequence opening via Enter key and double-click actions.
- Ensure proper handling of unsaved edits and sequence deletion scenarios.
- Verify accessibility features for picker rows across different languages.
- Introduce a dialog counting mechanism to manage unsaved edit confirmations.
This commit is contained in:
Alby96 committed 2026-10-19 12:10:42 +02:00
1 parent 4ea44bb917
commit 5aeb6aa787
214 files changed
+6547 -826

No files matched your search

+23 -2
View File
@@ -30,6 +30,7 @@ public sealed class ShellViewModel : LocalizedViewModel
private int _unseenFailures;
private WelcomeViewModel? _welcome;
private Guid? _currentSequenceId;
private int _sequenceRequests;
public ShellViewModel(AppServices services)
{
@@ -146,24 +147,44 @@ public sealed class ShellViewModel : LocalizedViewModel
private set => Set(ref _currentSequenceId, value);
}
/// <summary>
/// Counts <see cref="OpenSequence"/> calls: asking for the open sequence again (the Library, Jobs, a project file) ends a
/// choice of another in Edit, while coming back to Edit alone does not (owner review 1, R7).
/// </summary>
public int SequenceRequests
{
get => _sequenceRequests;
private set => Set(ref _sequenceRequests, value);
}
/// <summary>Loads the data of every screen once the index is open (or failed to open).</summary>
public async Task StartAsync()
{
if (Services.OpenError is { } error) ReportError(error);
Jobs.Attach();
await Library.AttachAsync();
// Edit opened before the index did shows its picker empty until now (neither "no sequences" nor Import).
if (Sequence.ShowsPicker && Sequence.IsSelected) _ = Sequence.Picker.ReloadAsync();
Settings.Attach();
About.Attach();
await Server.AttachAsync();
}
/// <summary>Opens a sequence in the editor.</summary>
/// <summary>Opens a sequence in Edit.</summary>
public void OpenSequence(Guid sequenceId)
{
CurrentSequenceId = sequenceId;
Navigate(SectionKey.Sequence);
SequenceRequests++;
Navigate(SectionKey.Edit);
}
/// <summary>
/// Edit's open sequence (or none) is again the sequence asked for: after Keep editing, a choice cancelled, an open that
/// failed, or the sequence asked for deleted. Coming back to Edit then neither asks once more nor tries again; asking
/// for a sequence again (<see cref="OpenSequence"/>) does.
/// </summary>
internal void KeepSequence(Guid? sequenceId) => CurrentSequenceId = sequenceId;
/// <summary>Closes the first-run overlay for good.</summary>
public void CompleteWelcome()
{