Skip to content

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

test: cover ChipTabs entry and keyboard selection

lord_Tyriona1a1a863cce2
diff --git a/app/src/components/layout/ChipTabs.test.tsx b/app/src/components/layout/ChipTabs.test.tsx
index 4c799ec1ab..347ad3dee6 100644
--- a/app/src/components/layout/ChipTabs.test.tsx
+++ b/app/src/components/layout/ChipTabs.test.tsx
@@ -44,6 +44,9 @@ describe('ChipTabs', () => {
// pre-interaction, so this one cannot be restored — not because jsdom can't
// traverse focus, but because the behavior it asserted no longer exists.
//
+ // Real Tab entry, arrows, Home/End and both wraps are covered by
+ // app/test/e2e/specs/chip-tabs-keyboard.spec.ts on the Search settings row.
+ //
// The other three tests below — the arrow-key it.each and the wrap test —
// are NOT a coverage gap: they're restored using `userEvent.keyboard(...)`
// rather than raw `fireEvent.keyDown` + manual `.focus()`. The raw-event
diff --git a/app/test/e2e/specs/chip-tabs-keyboard.spec.ts b/app/test/e2e/specs/chip-tabs-keyboard.spec.ts
new file mode 100644
index 0000000000..bd063b137e
--- /dev/null
+++ b/app/test/e2e/specs/chip-tabs-keyboard.spec.ts
@@ -0,0 +1,58 @@
+import { browser, expect } from '@wdio/globals';
+
+import { waitForApp } from '../helpers/app-helpers';
+import { waitForTestId } from '../helpers/element-helpers';
+import { resetApp } from '../helpers/reset-app';
+import { navigateViaHash } from '../helpers/shared-flows';
+import { startMockServer, stopMockServer } from '../mock-server';
+
+type Tab = 'providers' | 'routing' | 'websites';
+const TABS: Tab[] = ['providers', 'routing', 'websites'];
+
+async function expectSelectedAndFocused(selected: Tab): Promise<void> {
+ for (const tab of TABS) {
+ const element = await waitForTestId(`search-tab-${tab}`);
+ await expect(element).toHaveAttribute('aria-selected', String(tab === selected));
+ if (tab === selected) await expect(element).toBeFocused();
+ }
+}
+
+describe('ChipTabs keyboard traversal', () => {
+ before(async () => {
+ await startMockServer();
+ await waitForApp();
+ await resetApp('e2e-chip-tabs-keyboard');
+ });
+
+ after(async () => {
+ await stopMockServer();
+ });
+
+ it('enters on the active tab and selects with arrows, Home, End and wrapping', async () => {
+ await navigateViaHash('/settings/search');
+ await waitForTestId('search-settings-panel');
+ // Start in the middle so each jump changes the controlled selection.
+ const middle = await waitForTestId('search-tab-routing');
+ await middle.click();
+ await expectSelectedAndFocused('routing');
+
+ // Leave the row, then enter with a real Tab event. This exercises entry
+ // focus in Radix's roving group before the arrow-key assertions.
+ await browser.keys(['Shift', 'Tab']);
+ await expect(middle).not.toBeFocused();
+ await browser.keys('Tab');
+ await expectSelectedAndFocused('routing');
+
+ for (const [key, selected] of [
+ ['ArrowRight', 'websites'],
+ ['ArrowLeft', 'routing'],
+ ['Home', 'providers'],
+ ['End', 'websites'],
+ ['ArrowRight', 'providers'],
+ ['ArrowLeft', 'websites'],
+ ] as const) {
+ await browser.keys(key);
+ await expectSelectedAndFocused(selected);
+ }
+ });
+});
diff --git a/docs/TEST-COVERAGE-MATRIX.md b/docs/TEST-COVERAGE-MATRIX.md
index 38e5112695..751febbea6 100644
--- a/docs/TEST-COVERAGE-MATRIX.md
+++ b/docs/TEST-COVERAGE-MATRIX.md
@@ -334,7 +334,7 @@ End-to-end coverage of the agent harness via the web-chat RPC surface against an
| 7.2.3 | TinyFish Integration Tools | RU | `vendor/tinysearch` provider tests, `crates/openhuman-core/src/modules/search/config_tests.rs`, `crates/openhuman-core/src/search/providers_tests.rs` | ✅ | TinyFish is a managed TinySearch provider serving the search and contents roles; host tests cover its managed-only route and usability; request mapping is tested in the module |
| 7.2.4 | Exa search (managed + BYOK) | RU+RI+VU | `vendor/tinysearch` provider tests, `crates/openhuman-core/src/modules/search/config_tests.rs`, `tests/raw_coverage/worker_b_raw_coverage_e2e.rs::tools_web_search_success_path_uses_backend_session_and_shapes_results`, `crates/openhuman-core/src/config/ops/search_tests.rs`, `app/src/components/settings/panels/SearchPanel.test.tsx` | ✅ | Managed Exa posts `{objective, searchQueries}` (no `mode`) to `/agent-integrations/exa/search` through the loaded TinySearch module against a local backend; direct Exa keeps its key private in the module configuration; the panel switches route and saves/clears the key |
| 7.2.5 | Tavily BYOK search + extract (direct API) | RU+RI+VU | `vendor/tinysearch` provider tests, `crates/openhuman-core/src/config/ops_loader_and_search_tests.rs` (`apply_search_settings_stores_and_clears_tavily_key`), `tests/in_process/config_auth_app_state_connectivity_e2e.rs`, `app/src/components/settings/panels/SearchPanel.test.tsx` | ✅ | Tavily serves the search and contents roles with the user's key; the key round-trips through the settings RPC and secret encryption and is never returned; clearing it drops Tavily from `effective_roles` |
-| 7.2.6 | Multi-provider roles, fallback and grounded answers | RU+RI+VU | `crates/openhuman-core/src/search/{providers,render,tools,bus}_tests.rs`, `crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs`, `crates/openhuman-core/src/agent/session_host/recorded_tools_tests.rs`, `crates/openhuman-core/src/mcp/server/tools_tests_params_and_specs_tests.rs`, `tests/raw_coverage/worker_b_raw_coverage_e2e.rs::tools_web_answer_uses_managed_gemini_grounding_and_returns_citations`, `app/src/components/settings/panels/SearchPanel.test.tsx`, `app/src/features/conversations/tools/parseWebSearchResult.test.ts` | ✅ | Several providers at once: one agent tool per role (`web_search_tool`, `web_answer_tool`, `web_contents_tool`) served by the first usable provider with fallback (module tests); managed providers need a session and refresh on `CredentialChanged`; managed Gemini grounding returns an answer with citations end to end; single-engine settings migrate on load and Parallel stays as an own-key-only provider; resumed threads keep recorded role tools; chat renders answers, citations and fallback |
+| 7.2.6 | Multi-provider roles, fallback and grounded answers | RU+RI+VU | `crates/openhuman-core/src/search/{providers,render,tools,bus}_tests.rs`, `crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs`, `crates/openhuman-core/src/agent/session_host/recorded_tools_tests.rs`, `crates/openhuman-core/src/mcp/server/tools_tests_params_and_specs_tests.rs`, `tests/raw_coverage/worker_b_raw_coverage_e2e.rs::tools_web_answer_uses_managed_gemini_grounding_and_returns_citations`, `app/src/components/settings/panels/SearchPanel.test.tsx`, `app/src/features/conversations/tools/parseWebSearchResult.test.ts`, `app/test/e2e/specs/chip-tabs-keyboard.spec.ts` | ✅ | Several providers at once: one agent tool per role (`web_search_tool`, `web_answer_tool`, `web_contents_tool`) served by the first usable provider with fallback (module tests); managed providers need a session and refresh on `CredentialChanged`; managed Gemini grounding returns an answer with citations end to end; single-engine settings migrate on load and Parallel stays as an own-key-only provider; resumed threads keep recorded role tools; chat renders answers, citations and fallback |
| 7.2.8 | Backend socket connect deadline + reconnect diagnostics | RU | `crates/openhuman-core/src/platform/socket/ws_loop_deadline_tests.rs` (`connect_with_redirects_times_out_when_upgrade_never_answers`, `connect_timeout_is_not_tighter_than_a_handshake_read`, `ws_loop_reports_reconnecting_between_attempts`, `ws_loop_reconnects_after_ping_deadline_on_a_silent_server`), `crates/openhuman-core/src/core/observability_error_classification_network_tests.rs` (`classifies_socket_connect_deadline_as_network_unreachable`) (#6256) | ✅ | One connect attempt (DNS + TCP + TLS + upgrade) is bounded at 10 s per redirect hop and fails as the `operation timed out` transport shape the Sentry classifier demotes; the loop reports `reconnecting` between attempts and `disconnected` only when stopped; the ping-timeout warning carries connection age / EIO pings received / frames sent, and a handshake after an outage logs `Reconnected after …` |
| 7.2.7 | Connectivity chip — core↔hosted backend link | VU | `app/src/services/__tests__/coreHealthMonitor.test.ts`, `app/src/store/__tests__/connectivitySlice.test.ts`, `app/src/store/__tests__/connectivitySelectors.test.ts`, `app/src/components/__tests__/ConnectionIndicator.test.tsx` (#6256) | ✅ | `connectivity_diag.socket_state` + `socket_loop_active` are mirrored into `connectivity.hosted` by the health poll; with the loop alive, `connecting` / `reconnecting` / `disconnected` (server closed the namespace) render the amber `hosted-degraded` chip, ranked below every other channel; `socket_loop_active=false` or `uninitialized` collapse to `unknown` (no chip: signed out, local session, boot) unless `socket_loop_stopped_on_failure` says the loop exited on an unusable session, which renders `hosted-stopped` with "sign in again" copy; `error` (server error event on a live transport) is stored but is not a chip state; a degraded link selects the 5 s poll so recovery shows within seconds |