From b245335cc651c88b0b92824ef385faa7036a736d Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Fri, 27 Nov 2026 01:43:00 +0800 Subject: [PATCH] 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. --- e2e/databaseResultTabs.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/databaseResultTabs.spec.ts b/e2e/databaseResultTabs.spec.ts index 7cc55326d8..8b7c3cbff6 100644 --- a/e2e/databaseResultTabs.spec.ts +++ b/e2e/databaseResultTabs.spec.ts @@ -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); });