test(app): screen tests start past the first-run dialog; look inside dialogs once laid out
The shell is now disabled behind the first-run dialog, so the sample app used by the screen tests completes the first run unless a test asks for it (the Arabic start-up test does). The Archive right-to-left test rendered after looking for the dialogs' texts, which exist only once laid out; the padding test moves to the Settings page that has text boxes without an icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
2 files changed
+10
-6
No files matched your search
@@ -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<SettingsView>("settings");
|
||||
app.Shell.Settings.Page = SettingsPage.Archive;
|
||||
await app.ExpectAsync<SettingsView>("settings-archive");
|
||||
var boxes = app.FindAll<TextBox>().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;
|
||||
|
||||
/// <param name="language">The UI language, applied before the window is created (as at start-up).</param>
|
||||
public static async Task<SampleApp> StartAsync(string language = "en")
|
||||
/// <param name="firstRun">Opens with the first-run dialog, which keeps the shell behind it disabled.</param>
|
||||
public static async Task<SampleApp> 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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user