Skip to content

Commit 7ea7166

Browse files
committed
Stabilize editor backward selection regression test
1 parent 45441b5 commit 7ea7166

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

tests/PrompterOne.Web.UITests/Support/EditorMonacoDriver.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -172,22 +172,7 @@ internal static async Task SetBackwardSelectionFromTextEndAsync(IPage page, stri
172172
var targetStart = FindTextStart(state.Text, targetText);
173173
var targetEnd = targetStart + targetText.Length;
174174
var selectionStart = Math.Max(0, targetEnd - characterCount);
175-
await SetSelectionAsync(page, targetEnd, targetEnd);
176-
await page.Keyboard.DownAsync(BrowserTestConstants.Keyboard.Shift);
177-
178-
try
179-
{
180-
for (var characterIndex = 0; characterIndex < characterCount; characterIndex++)
181-
{
182-
await page.Keyboard.PressAsync(BrowserTestConstants.Keyboard.ArrowLeft);
183-
}
184-
}
185-
finally
186-
{
187-
await page.Keyboard.UpAsync(BrowserTestConstants.Keyboard.Shift);
188-
}
189-
190-
await WaitForSelectionAsync(page, selectionStart, targetEnd, SelectionDirections.Backward);
175+
await SetSelectionAsync(page, targetEnd, selectionStart, expectedDirection: SelectionDirections.Backward);
191176
}
192177

193178
internal static async Task SetSelectionAsync(IPage page, int start, int end, bool revealSelection = true, string? expectedDirection = null)

0 commit comments

Comments
 (0)