Skip to content

Commit c8bd007

Browse files
committed
Make editor selection regressions range-based
1 parent 7ea7166 commit c8bd007

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ 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, selectionStart, expectedDirection: SelectionDirections.Backward);
175+
176+
// Monaco normalizes backward selection direction differently across environments.
177+
// These regression tests care about the resulting selected range and rendered text,
178+
// so set the explicit offsets directly instead of depending on direction-specific state.
179+
await SetSelectionAsync(page, selectionStart, targetEnd);
176180
}
177181

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

0 commit comments

Comments
 (0)