Files
orca/tests/e2e/omp-title-marker.spec.ts
Neilandshahidbeig-a11y 3632311d0b fix(omp): preserve status after terminal title owner rewrite (#20610)
Validated and independently reviewed OMP integration fix.

Co-authored-by: shahidbeig-a11y <258701601+shahidbeig-a11y@users.noreply.github.com>
2026-09-14 13:56:18 -07:00

44 lines
1.6 KiB
TypeScript

import { writeFile } from 'node:fs/promises'
import { buildShellCommandFromArgv } from '../../src/shared/tui-agent-startup-shell'
import { test, expect } from './helpers/orca-app'
import { ensureTerminalVisible, waitForActiveWorktree, waitForSessionReady } from './helpers/store'
import {
execInTerminal,
sendToTerminal,
waitForActivePanePtyId,
waitForActiveTerminalManager
} from './helpers/terminal'
test('OMP spaced-colon title renders working and clears on idle', async ({
orcaPage
}, testInfo) => {
test.skip(
process.platform === 'win32',
'POSIX title replay; Windows formatter bytes have separate coverage'
)
await waitForSessionReady(orcaPage)
await waitForActiveWorktree(orcaPage)
await ensureTerminalVisible(orcaPage)
await waitForActiveTerminalManager(orcaPage)
const ptyId = await waitForActivePanePtyId(orcaPage)
const script = testInfo.outputPath('title-replay.cjs')
await writeFile(
script,
`
process.stdout.write('\\x1b]0;OMP : Image review\\x07')
process.stdin.on('data', () => process.stdout.write('\\x1b]0;OMP > Image review\\x07'))
`
)
await execInTerminal(
orcaPage,
ptyId,
buildShellCommandFromArgv([process.execPath, script], 'posix')
)
const working = orcaPage.locator('[aria-label="Working"]')
await expect(working.first()).toBeVisible({ timeout: 15000 })
await orcaPage.screenshot({ path: testInfo.outputPath('omp-title-working.png') })
await sendToTerminal(orcaPage, ptyId, '\r')
await expect(working).toHaveCount(0)
await orcaPage.screenshot({ path: testInfo.outputPath('omp-title-idle.png') })
})