Add test coverage for Cursor Agent trust-dialog banner detection

Verify lastIndexOf picks the later ready banner over an earlier
"Cursor Agent" mention in the trust dialog body, for both the
idle-resolution and busy-detection cases.
This commit is contained in:
Jinjing
2026-07-10 22:53:39 -07:00
parent af93ba949d
commit 088d613e55
+5
View File
@@ -10565,6 +10565,9 @@ describe('OrcaRuntimeService', () => {
runtime.onPtyData(
'pty-bg',
[
// Trust dialog body can mention "Cursor Agent" before the ready banner;
// lastIndexOf must pick the later banner, not this earlier hit.
'Cursor Agent\n',
'⚠ Workspace Trust Required\n',
'Do you trust the contents of this directory?\n',
' ▶ [a] Trust this workspace\n',
@@ -10596,6 +10599,8 @@ describe('OrcaRuntimeService', () => {
runtime.onPtyData(
'pty-bg',
[
// Same earlier "Cursor Agent" hit as the idle case — banner must win.
'Cursor Agent\n',
'⚠ Workspace Trust Required\n',
'Do you trust the contents of this directory?\n',
' ▶ [a] Trust this workspace\n',