test(e2e): put the caret on a query line by clicking it, not with Cmd+Up (#6231)

The result tab rename e2e test pressed Cmd+Up to move the caret to the first line, but in the IntelliJ macOS keymap Cmd+Up is Jump to Navigation Bar. The following Cmd+Backspace only deleted the editor line because editor text actions ran while a popup was open; since #6187 a key pressed in a popup belongs to the popup, so the test failed. Click the first line instead.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-27 01:43:00 +08:00
1 джерело e13ed093ec
коміт b245335cc6
1 file changed
+3 -3
+3 -3
Переглянути файл
@@ -411,7 +411,8 @@ test("rename owns deletion and Cmd+Enter without editing the previously focused
await page.keyboard.press("Meta+a");
const query = "SELECT 'keep this query';\nSELECT 2;";
await page.keyboard.insertText(query);
await page.keyboard.press("Meta+ArrowUp");
// Caret on the first line (Cmd+Up is Jump to Navigation Bar, not a caret move).
await content.locator(".cm-line").first().click();
await expect(content).toHaveText(query.replace("\n", ""));
await choose(page, "Result 1", "Rename Tab");
@@ -439,8 +440,7 @@ test("rename owns deletion and Cmd+Enter without editing the previously focused
await expect(content).toHaveText(query.replace("\n", ""));
// The editor's own Delete Line shortcut still works after the dialog closes.
await content.click();
await page.keyboard.press("Meta+ArrowUp");
await content.locator(".cm-line").first().click();
await page.keyboard.press("Meta+Backspace");
await expect(content.locator(".cm-line").filter({ hasText: /SELECT/ })).toHaveCount(1);
});