Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test: update unrouted approval tests for adapter changes

Steven Enamakel28671565545f
diff --git a/app/src/pages/__tests__/Conversations.unroutedApproval.test.tsx b/app/src/pages/__tests__/Conversations.unroutedApproval.test.tsx
index 585b578269..1e6ae203bb 100644
--- a/app/src/pages/__tests__/Conversations.unroutedApproval.test.tsx
+++ b/app/src/pages/__tests__/Conversations.unroutedApproval.test.tsx
@@ -124,8 +124,10 @@ describe('a background approval on /chat', () => {
const card = await screen.findByTestId('unrouted-approval-card', undefined, { timeout: 5000 });
// The tool, so the user can tell what is being asked, not just that
- // something is.
- expect(screen.getByTestId('unrouted-approval-tool')).toHaveTextContent('triage.escalate');
+ // something is — rendered as the shared `ApprovalCardAdapter`'s command
+ // panel now (the tool name doubles as the command when the gate has no
+ // redacted command/path/url of its own).
+ expect(card).toHaveTextContent('triage.escalate');
expect(card).toHaveTextContent('triage::ESCALATE');
});
@@ -134,7 +136,7 @@ describe('a background approval on /chat', () => {
await renderChatRoute();
await screen.findByTestId('unrouted-approval-card', undefined, { timeout: 5000 });
- await userEvent.click(screen.getByRole('button', { name: /approve once/i }));
+ await userEvent.click(screen.getByRole('button', { name: 'Approve' }));
await waitFor(() =>
expect(vi.mocked(decideApproval)).toHaveBeenCalledWith('req-triage-1', 'approve_once')
diff --git a/crates/openhuman-core/src/web_chat/suggestions_tests.rs b/crates/openhuman-core/src/web_chat/suggestions_tests.rs
index 709ff7af0f..546011cfd1 100644
--- a/crates/openhuman-core/src/web_chat/suggestions_tests.rs
+++ b/crates/openhuman-core/src/web_chat/suggestions_tests.rs
@@ -6,6 +6,7 @@ use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};
use super::*;
use crate::inference::provider::factory::test_provider_override;
+use crate::web_chat::subscribe_web_channel_events;
// ── parse_suggestions / strip_markdown_fence: pure unit tests ──────────────
@@ -114,7 +115,7 @@ async fn emits_chat_suggestions_for_a_well_formed_reply() {
text: r#"[{"prompt": "What's next?", "label": "Next steps"}]"#.to_string(),
calls: Arc::new(AtomicUsize::new(0)),
}));
- let mut rx = super::super::subscribe_web_channel_events();
+ let mut rx = subscribe_web_channel_events();
let thread_id = "sugg-thread-ok";
generate_and_emit(