test(app): the timeline answers the keyboard; capture scenes for Save view and the trash
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
1 file changed
+14
-1
@@ -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<LibraryView>("library-timeline", waitForThumbnails: true);
|
||||
var bands = Assert.NotNull(app.FindAll<TimelineBands>().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<LibraryView>("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<Button>().FirstOrDefault(b => ReferenceEquals(b.Command, command) && b.IsVisible), "a visible button bound to the command");
|
||||
|
||||
|
||||
Reference in new issue
Block a user