diff --git a/tests/Titano.App.Tests/Archive/ArchiveScreenSmokeTests.cs b/tests/Titano.App.Tests/Archive/ArchiveScreenSmokeTests.cs index a9428ce6..835fd41e 100644 --- a/tests/Titano.App.Tests/Archive/ArchiveScreenSmokeTests.cs +++ b/tests/Titano.App.Tests/Archive/ArchiveScreenSmokeTests.cs @@ -127,17 +127,18 @@ public sealed class ArchiveScreenSmokeTests Assert.Equal(Loc.L("Tooltips.Archive.YearRowRtl", year.Title + " ยท " + year.Detail), year.RowToolTip, "the tooltip names the mirrored arrow keys"); await app.ExpectAsync("archive-overview-ar"); + // The dialogs' templates exist once they are laid out: render first, then look inside. await ArchiveScenes.ShowAsync(app.Shell, "rebuild"); - Assert.Equal(FlowDirection.LeftToRight, TextFor(app, archive.SelectedArchive!.RootPath).FlowDirection, "the archive folder reads left to right"); await app.ExpectAsync("archive-rebuild-ar"); + Assert.Equal(FlowDirection.LeftToRight, TextFor(app, archive.SelectedArchive!.RootPath).FlowDirection, "the archive folder reads left to right"); await ArchiveScenes.ShowAsync(app.Shell, "move"); var move = Assert.NotNull(archive.Dialog as RenameDialogViewModel); + await app.ExpectAsync("archive-move-ar"); var template = Assert.NotNull(app.FindAll().FirstOrDefault(t => t.IsVisible && EditBehavior.GetField(t) == move.Template)); Assert.Equal(FlowDirection.LeftToRight, template.FlowDirection, "the naming template reads left to right"); Assert.Equal(FlowDirection.LeftToRight, TextFor(app, move.Rows[0].From).FlowDirection, "a folder before the move reads left to right"); Assert.Equal(FlowDirection.LeftToRight, TextFor(app, move.Rows[0].To).FlowDirection, "a folder after the move reads left to right"); - await app.ExpectAsync("archive-move-ar"); move.CloseCommand.Execute(null); } finally diff --git a/tests/Titano.App.Tests/Windows/ScreenSmokeTests.cs b/tests/Titano.App.Tests/Windows/ScreenSmokeTests.cs index 49784149..97909a98 100644 --- a/tests/Titano.App.Tests/Windows/ScreenSmokeTests.cs +++ b/tests/Titano.App.Tests/Windows/ScreenSmokeTests.cs @@ -132,7 +132,7 @@ public sealed class ScreenSmokeTests public Task ArabicMirrorsTheShellFromStartButNotItsPicturesOrLogo() => ScreenHost.RunAsync(async () => { // The language is applied before the window exists, as at start-up with Arabic saved in the settings. - await using var app = await SampleApp.StartAsync("ar"); + await using var app = await SampleApp.StartAsync("ar", firstRun: true); try { var window = app.Window; @@ -220,7 +220,8 @@ public sealed class ScreenSmokeTests // A text box hands its padding to the text itself; the template adds none (8 px after a leading icon). app.Shell.Navigate(SectionKey.Settings); - await app.ExpectAsync("settings"); + app.Shell.Settings.Page = SettingsPage.Archive; + await app.ExpectAsync("settings-archive"); var boxes = app.FindAll().Where(t => t.IsVisible).ToList(); Assert.Contains(boxes, t => Field.GetGlyph(t) is not null); Assert.Contains(boxes, t => Field.GetGlyph(t) is null); @@ -258,12 +259,14 @@ public sealed class ScreenSmokeTests public MainWindow Window => _window; /// The UI language, applied before the window is created (as at start-up). - public static async Task StartAsync(string language = "en") + /// Opens with the first-run dialog, which keeps the shell behind it disabled. + public static async Task StartAsync(string language = "en", bool firstRun = false) { var environment = AppEnvironment.ForCapture(); UiLanguage.Apply(language); ThemeManager.Apply(AppTheme.Dark); - var services = new AppServices(environment, new AppSettings { Language = language }, () => { }, new NoDialogs()); + var settings = new AppSettings { Language = language, FirstRunCompleted = !firstRun }; + var services = new AppServices(environment, settings, () => { }, new NoDialogs()); var sample = SampleData.Configure(services); var shell = new ShellViewModel(services);