mirror of
https://github.com/stablyai/orca.git
synced 2026-09-23 00:02:29 +00:00
Validated and independently reviewed OMP integration fix. Co-authored-by: shahidbeig-a11y <258701601+shahidbeig-a11y@users.noreply.github.com>
44 lines
1.6 KiB
TypeScript
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') })
|
|
})
|