summaryrefslogtreecommitdiffhomepage
path: root/packages/app/e2e
diff options
context:
space:
mode:
authorFilip <[email protected]>2026-03-22 05:39:51 +0100
committerGitHub <[email protected]>2026-03-22 04:39:51 +0000
commitc529529f84ef60f93ae187b2d89824852b365508 (patch)
tree19c104f08a74f6dfc3f3a7e9bfcac02b475f8268 /packages/app/e2e
parent13bac9c91a908f560f74f19a49c7c865e4bfd5ec (diff)
downloadopencode-c529529f84ef60f93ae187b2d89824852b365508.tar.gz
opencode-c529529f84ef60f93ae187b2d89824852b365508.zip
fix(app): terminal rename from context menu (#18263)
Co-authored-by: Brendan Allan <[email protected]>
Diffstat (limited to 'packages/app/e2e')
-rw-r--r--packages/app/e2e/terminal/terminal-tabs.spec.ts38
1 files changed, 37 insertions, 1 deletions
diff --git a/packages/app/e2e/terminal/terminal-tabs.spec.ts b/packages/app/e2e/terminal/terminal-tabs.spec.ts
index ca1f7eee8..6b6fa4c62 100644
--- a/packages/app/e2e/terminal/terminal-tabs.spec.ts
+++ b/packages/app/e2e/terminal/terminal-tabs.spec.ts
@@ -1,7 +1,7 @@
import type { Page } from "@playwright/test"
import { runTerminal, waitTerminalReady } from "../actions"
import { test, expect } from "../fixtures"
-import { terminalSelector } from "../selectors"
+import { dropdownMenuContentSelector, terminalSelector } from "../selectors"
import { terminalToggleKey, workspacePersistKey } from "../utils"
type State = {
@@ -130,3 +130,39 @@ test("closing the active terminal tab falls back to the previous tab", async ({
.toEqual({ count: 1, first: true })
})
})
+
+test("terminal tab can be renamed from the context menu", async ({ page, withProject }) => {
+ await withProject(async ({ directory, gotoSession }) => {
+ const key = workspacePersistKey(directory, "terminal")
+ const rename = `E2E term ${Date.now()}`
+ const tab = page.locator('#terminal-panel [data-slot="tabs-trigger"]').first()
+
+ await gotoSession()
+ await open(page)
+
+ await expect(tab).toContainText(/Terminal 1/)
+ await tab.click({ button: "right" })
+
+ const menu = page.locator(dropdownMenuContentSelector).first()
+ await expect(menu).toBeVisible()
+ await menu.getByRole("menuitem", { name: /^Rename$/i }).click()
+ await expect(menu).toHaveCount(0)
+
+ const input = page.locator('#terminal-panel input[type="text"]').first()
+ await expect(input).toBeVisible()
+ await input.fill(rename)
+ await input.press("Enter")
+
+ await expect(input).toHaveCount(0)
+ await expect(tab).toContainText(rename)
+ await expect
+ .poll(
+ async () => {
+ const state = await store(page, key)
+ return state?.all[0]?.title
+ },
+ { timeout: 5_000 },
+ )
+ .toBe(rename)
+ })
+})