Merge branch 'review2-p1-desktop-about' into claude/owner-review-2-p1
This commit is contained in:
commit
a11fe8d27a
143 files changed
+187
-498
No files matched your search
@@ -320,14 +320,60 @@ public sealed class SettingsScreenSmokeTests
|
||||
app.Shell.CompleteWelcome();
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task AboutIsTheLastSettingsPageAndOffersNothingTwice() => ScreenHost.RunAsync(async () =>
|
||||
{
|
||||
// Owner review 2, R5: About left the rail for the end of Settings; Settings alone docks at the bottom of the rail.
|
||||
await using var app = await ScreenSmokeTests.SampleApp.StartAsync();
|
||||
var shell = app.Shell;
|
||||
var settings = shell.Settings;
|
||||
Assert.SequenceEqual([SectionKey.Settings], shell.BottomSections.Select(s => s.Key));
|
||||
Assert.Equal(SettingsPage.About, settings.AllPages[^1].Page);
|
||||
|
||||
shell.About.SetResult(null);
|
||||
shell.Navigate(SectionKey.Settings);
|
||||
settings.Page = SettingsPage.About;
|
||||
await app.ExpectAsync<SettingsView>("settings-about");
|
||||
Assert.Equal(Loc.L("Settings.Page.About"), settings.PageTitle);
|
||||
// This copy's identity: nothing to reset.
|
||||
Assert.False(settings.CanResetSection);
|
||||
Assert.False(app.FindAll<Button>().Any(b => b.Content as string == Loc.L("Settings.ResetSection") && b.IsVisible), "no Reset section on About");
|
||||
Assert.True(app.FindAll<TextBlock>().Any(t => t.IsVisible && t.Text == shell.About.Build), "the build is shown");
|
||||
var licence = app.FindAll<Button>().Single(b => b.IsVisible && ReferenceEquals(b.Command, shell.About.OpenLicenceCommand));
|
||||
Assert.Equal(Loc.L("Tooltips.About.Licence"), licence.ToolTip);
|
||||
// English is the source language: no translation notice.
|
||||
Assert.False(app.FindAll<Button>().Any(b => b.IsVisible && ReferenceEquals(b.Command, shell.About.ReviewTranslationCommand)), "no review link in English");
|
||||
|
||||
// One place each in Settings: the update check (Updates), the data folder and the diagnostics bundle (Advanced).
|
||||
// (Rows build their content when first shown: those pages are shown once.)
|
||||
foreach (var page in (SettingsPage[])[SettingsPage.Updates, SettingsPage.Advanced, SettingsPage.About])
|
||||
{
|
||||
settings.Page = page;
|
||||
app.Window.UpdateLayout();
|
||||
}
|
||||
var buttons = app.FindAll<Button>();
|
||||
Assert.Count(1, buttons.Where(b => ReferenceEquals(b.Command, shell.About.CheckCommand)));
|
||||
Assert.Count(1, buttons.Where(b => ReferenceEquals(b.Command, settings.OpenDataFolderCommand)));
|
||||
Assert.Count(1, buttons.Where(b => ReferenceEquals(b.Command, settings.ExportDiagnosticsCommand)));
|
||||
|
||||
// The search finds About by its rows and Updates by its releases link.
|
||||
settings.SearchText = Loc.L("About.Build");
|
||||
Assert.Contains(settings.VisiblePages, p => p.Page == SettingsPage.About);
|
||||
settings.SearchText = Loc.L("About.Releases");
|
||||
Assert.Contains(settings.VisiblePages, p => p.Page == SettingsPage.Updates);
|
||||
settings.SearchText = string.Empty;
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task ARightToLeftLanguageMirrorsEveryWindowAlsoThoseOpenedLater() => ScreenHost.RunAsync(async () =>
|
||||
{
|
||||
await using var app = await ScreenSmokeTests.SampleApp.StartAsync();
|
||||
var settings = app.Shell.Settings;
|
||||
app.Shell.About.SetResult(null);
|
||||
app.Shell.Navigate(SectionKey.About);
|
||||
await app.ExpectAsync<AboutView>("about");
|
||||
var main = Window.GetWindow(app.FindAll<AboutView>().First(v => v.IsVisible));
|
||||
app.Shell.Navigate(SectionKey.Settings);
|
||||
settings.Page = SettingsPage.About;
|
||||
await app.ExpectAsync<SettingsView>("settings-about");
|
||||
var main = Window.GetWindow(app.FindAll<SettingsView>().First(v => v.IsVisible));
|
||||
Assert.Equal(FlowDirection.LeftToRight, main.FlowDirection);
|
||||
|
||||
UiLanguage.Apply("ar");
|
||||
@@ -350,13 +396,26 @@ public sealed class SettingsScreenSmokeTests
|
||||
dialog.Show();
|
||||
await loaded.Task.WaitAsync(TimeSpan.FromSeconds(10));
|
||||
Assert.Equal(FlowDirection.RightToLeft, dialog.FlowDirection, "a window opened after the switch (a dialog) is mirrored too");
|
||||
await app.ExpectAsync<AboutView>("about-ar");
|
||||
await app.ExpectAsync<SettingsView>("settings-about-ar");
|
||||
|
||||
// Inside the mirrored window, paths and the logo keep their left-to-right order.
|
||||
var path = app.FindAll<TextBlock>().First(t => t.IsVisible && t.Text == app.Shell.About.DataFolder);
|
||||
// Inside the mirrored window, the logo and the build keep their left-to-right order; the translation notice shows.
|
||||
var logos = app.FindAll<Chronos.Ui.Controls.BrandMarkIcon>().Where(b => b.IsVisible).ToList();
|
||||
Assert.NotEmpty(logos);
|
||||
Assert.True(logos.All(b => b.FlowDirection == FlowDirection.LeftToRight), "the logo is not mirrored");
|
||||
var build = app.FindAll<TextBlock>().First(t => t.IsVisible && t.Text == app.Shell.About.Build);
|
||||
Assert.Equal(FlowDirection.LeftToRight, build.FlowDirection);
|
||||
Assert.True(app.FindAll<Button>().Any(b => b.IsVisible && ReferenceEquals(b.Command, app.Shell.About.ReviewTranslationCommand)), "Arabic is machine-translated");
|
||||
|
||||
// Paths keep their left-to-right order and show whole in their tooltip.
|
||||
settings.Page = SettingsPage.Advanced;
|
||||
await app.ExpectAsync<SettingsView>("settings-advanced-ar");
|
||||
var path = Field(app, Loc.L("Settings.Advanced.DataFolder"));
|
||||
Assert.Equal(FlowDirection.LeftToRight, path.FlowDirection);
|
||||
Assert.Equal(app.Shell.About.DataFolder, path.ToolTip);
|
||||
Assert.Equal(settings.DataFolder, path.ToolTip);
|
||||
|
||||
// The update result is a live region: screen readers hear each new state.
|
||||
settings.Page = SettingsPage.Updates;
|
||||
await app.ExpectAsync<SettingsView>("settings-updates-ar");
|
||||
var update = app.FindAll<Chronos.Ui.Controls.StatusGlyph>().First(g => g.IsVisible && g.Text == app.Shell.About.UpdateText);
|
||||
Assert.Equal(AutomationLiveSetting.Polite, AutomationProperties.GetLiveSetting(update));
|
||||
Assert.Equal(app.Shell.About.UpdateAnnouncement, AutomationProperties.GetName(update));
|
||||
|
||||
@@ -92,6 +92,7 @@ public sealed class ScreenSmokeTests
|
||||
Assert.True(shell.Server.IsConnected, "the saved session is restored");
|
||||
await app.ExpectAsync<ServerView>("server");
|
||||
|
||||
// Every Settings page, About last (owner review 2, R5).
|
||||
shell.Navigate(SectionKey.Settings);
|
||||
Assert.Equal(3, shell.Settings.PreviewNames.Count);
|
||||
Assert.Equal(6, shell.Settings.Encoders.Count);
|
||||
@@ -101,9 +102,6 @@ public sealed class ScreenSmokeTests
|
||||
await app.ExpectAsync<SettingsView>("settings-" + page.ToString().ToLowerInvariant());
|
||||
}
|
||||
|
||||
shell.Navigate(SectionKey.About);
|
||||
await app.ExpectAsync<AboutView>("about");
|
||||
|
||||
shell.Navigate(SectionKey.Import);
|
||||
await app.ExpectAsync<ImportView>("import");
|
||||
// Edit with no sequence open: the picker lists the sequences (owner review 1, R7).
|
||||
|
||||
Reference in new issue
Block a user