Skip to content

Commit

Permalink
fix(tests): When_Ctrl_Delete on macOS/skia
Browse files Browse the repository at this point in the history
  • Loading branch information
spouliot committed Nov 4, 2024
1 parent 8fc014a commit 8547cbd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,16 @@ public async Task When_Ctrl_Delete()
SUT.Focus(FocusState.Programmatic);
await WindowHelper.WaitForIdle();

SUT.SafeRaiseEvent(UIElement.KeyDownEvent, new KeyRoutedEventArgs(SUT, VirtualKey.Delete, VirtualKeyModifiers.Control));
// on macOS it's option (menu/alt) and backspace to delete a word
var mod = OperatingSystem.IsMacOS() ? VirtualKeyModifiers.Menu : VirtualKeyModifiers.Control;
SUT.SafeRaiseEvent(UIElement.KeyDownEvent, new KeyRoutedEventArgs(SUT, VirtualKey.Delete, mod));
await WindowHelper.WaitForIdle();

Assert.AreEqual("ipsum dolor", SUT.Text);
Assert.AreEqual(0, SUT.SelectionStart);
Assert.AreEqual(0, SUT.SelectionLength);

SUT.SafeRaiseEvent(UIElement.KeyDownEvent, new KeyRoutedEventArgs(SUT, VirtualKey.Delete, VirtualKeyModifiers.Control));
SUT.SafeRaiseEvent(UIElement.KeyDownEvent, new KeyRoutedEventArgs(SUT, VirtualKey.Delete, mod));
await WindowHelper.WaitForIdle();

Assert.AreEqual("dolor", SUT.Text);
Expand Down

0 comments on commit 8547cbd

Please sign in to comment.