From 20c1b8d6c387896ec11ea546c21aaf37d4927118 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 08:22:34 +0000 Subject: [PATCH] test(app): the timeline answers the keyboard; capture scenes for Save view and the trash Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC --- .../Library/LibraryScreenSmokeTests.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/Titano.App.Tests/Library/LibraryScreenSmokeTests.cs b/tests/Titano.App.Tests/Library/LibraryScreenSmokeTests.cs index e7296598..c9b0f30a 100644 --- a/tests/Titano.App.Tests/Library/LibraryScreenSmokeTests.cs +++ b/tests/Titano.App.Tests/Library/LibraryScreenSmokeTests.cs @@ -7,6 +7,7 @@ using Titano.App.Library; using Titano.App.Sections; using Titano.App.Shell; using Titano.App.Tests.Windows; +using Titano.Core.Localization; using Titano.Testing; using Titano.Ui.Visuals; @@ -40,6 +41,15 @@ public sealed class LibraryScreenSmokeTests await app.ExpectAsync("library-timeline", waitForThumbnails: true); var bands = Assert.NotNull(app.FindAll().FirstOrDefault(t => t.IsVisible && t.ActualHeight > 0), "the bands are drawn"); Assert.True(bands.Focusable, "the keyboard reaches the months"); + // Without the mouse: Enter on the month under the keyboard narrows the Library to its year. + library.ClearFiltersCommand.Execute(null); + await library.RefreshAsync(); + Assert.Equal(-1, library.TimelineBand); + bands.Focus(); + Press(bands, Key.Enter); + await library.RefreshAsync(); + Assert.True(library.TimelineBand >= 0 && library.TimelineSlot >= 0, "Enter chose a month"); + Assert.True(library.IsYearFiltered, "the year filter follows the band"); await LibraryScenes.ShowAsync(app.Shell, "mass"); Assert.Equal(LibraryScenes.MassSelection, library.SelectionCount); @@ -82,7 +92,7 @@ public sealed class LibraryScreenSmokeTests Assert.False(library.DeleteCommand.CanExecute(null), "a remote card has nothing here to delete"); Assert.True(library.DownloadCommand.CanExecute(null), "its originals can come here"); Assert.False(library.RevealCommand.CanExecute(null), "a remote card has no folder here"); - Assert.Equal(Core.Localization.Loc.L("Library.Blocked.ServerOnly"), library.RevealToolTip); + Assert.Equal(Loc.L("Library.Blocked.ServerOnly"), library.RevealToolTip); await app.ExpectAsync("library-remote"); Assert.True(library.Years.Count > 1, "the server's years are choices too"); @@ -143,6 +153,9 @@ public sealed class LibraryScreenSmokeTests trash.CloseCommand.Execute(null); }); + private static void Press(UIElement target, Key key) => + target.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(target)!, 0, key) { RoutedEvent = Keyboard.KeyDownEvent }); + private static Button ButtonFor(ScreenSmokeTests.SampleApp app, ICommand command) => Assert.NotNull(app.FindAll