From c529529f84ef60f93ae187b2d89824852b365508 Mon Sep 17 00:00:00 2001 From: Filip <34747899+neriousy@users.noreply.github.com> Date: Sun, 22 Mar 2026 05:39:51 +0100 Subject: fix(app): terminal rename from context menu (#18263) Co-authored-by: Brendan Allan --- packages/app/e2e/terminal/terminal-tabs.spec.ts | 38 ++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'packages/app/e2e') 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) + }) +}) -- cgit v1.2.3