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:
1 parent
4ea44bb917
commit
5aeb6aa787
214 files changed
+6547
-826
No files matched your search
@@ -106,8 +106,11 @@ public sealed class ScreenSmokeTests
|
||||
|
||||
shell.Navigate(SectionKey.Import);
|
||||
await app.ExpectAsync<ImportView>("import");
|
||||
shell.Navigate(SectionKey.Sequence);
|
||||
await app.ExpectAsync<SequenceView>("sequence");
|
||||
// Edit with no sequence open: the picker lists the sequences (owner review 1, R7).
|
||||
shell.Navigate(SectionKey.Edit);
|
||||
await shell.Sequence.Picker.Loading;
|
||||
await app.ExpectAsync<SequenceView>("edit-picker");
|
||||
Assert.True(shell.Sequence.ShowsPicker);
|
||||
shell.Navigate(SectionKey.Archive);
|
||||
await app.ExpectAsync<ArchiveView>("archive");
|
||||
});
|
||||
@@ -155,7 +158,7 @@ public sealed class ScreenSmokeTests
|
||||
await app.Shell.Sequence.OpenAsync(id);
|
||||
var editor = Assert.NotNull(app.Shell.Sequence.Editor);
|
||||
Assert.True(await editor.WhenIdleAsync(TimeSpan.FromSeconds(60)), "the editor settled");
|
||||
await app.ExpectAsync<SequenceView>("sequence-ar");
|
||||
await app.ExpectAsync<SequenceView>("edit-ar");
|
||||
|
||||
// Directional glyphs follow the reading direction; the others, the logo, the picture and the charts do not.
|
||||
var back = Assert.NotNull(app.FindAll<Button>().FirstOrDefault(b => b.IsVisible && ReferenceEquals(b.Command, editor.BackCommand)), "the editor's Back button");
|
||||
@@ -272,13 +275,14 @@ public sealed class ScreenSmokeTests
|
||||
/// <param name="language">The UI language, applied before the window is created (as at start-up).</param>
|
||||
/// <param name="firstRun">Opens with the first-run dialog, which keeps the shell behind it disabled.</param>
|
||||
/// <param name="saveSettings">Runs where the app writes its settings file (nothing is written by default).</param>
|
||||
public static async Task<SampleApp> StartAsync(string language = "en", bool firstRun = false, Action? saveSettings = null)
|
||||
/// <param name="dialogs">Answers the app's dialogs (by default every confirmation is declined).</param>
|
||||
public static async Task<SampleApp> StartAsync(string language = "en", bool firstRun = false, Action? saveSettings = null, IAppDialogs? dialogs = null)
|
||||
{
|
||||
var environment = AppEnvironment.ForCapture();
|
||||
UiLanguage.Apply(language);
|
||||
ThemeManager.Apply(AppTheme.Dark);
|
||||
var settings = new AppSettings { Language = language, FirstRunCompleted = !firstRun };
|
||||
var services = new AppServices(environment, settings, saveSettings ?? (() => { }), new NoDialogs());
|
||||
var services = new AppServices(environment, settings, saveSettings ?? (() => { }), dialogs ?? new NoDialogs());
|
||||
var sample = SampleData.Configure(services);
|
||||
var shell = new ShellViewModel(services);
|
||||
|
||||
|
||||
Reference in new issue
Block a user