Skip to content

Commit

Permalink
fix(tests): When_Ctrl_End_ScrollViewer_Vertical_Offset on macOS/skia
Browse files Browse the repository at this point in the history
  • Loading branch information
spouliot committed Nov 4, 2024
1 parent 3e1c56c commit 6acb0cd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ public async Task When_Ctrl_End_ScrollViewer_Vertical_Offset()

Assert.AreEqual(0, ((ScrollViewer)SUT.ContentElement).VerticalOffset);

SUT.SafeRaiseEvent(UIElement.KeyDownEvent, new KeyRoutedEventArgs(SUT, VirtualKey.End, VirtualKeyModifiers.Control));
// on macOS moving to the end of the document is done with `Command` + `Down`
var macOS = OperatingSystem.IsMacOS();
var key = macOS ? VirtualKey.Down : VirtualKey.End;
var mod = macOS ? VirtualKeyModifiers.Windows : VirtualKeyModifiers.Control;
SUT.SafeRaiseEvent(UIElement.KeyDownEvent, new KeyRoutedEventArgs(SUT, key, mod));
await WindowHelper.WaitForIdle();

((ScrollViewer)SUT.ContentElement).VerticalOffset.Should().BeApproximately(((ScrollViewer)SUT.ContentElement).ScrollableHeight, 1.0);
Expand Down

0 comments on commit 6acb0cd

Please sign in to comment.