Skip to content

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

test(settings): render hop two instead of grepping for it\n\nComplements the source-level pin already on this branch rather than replacing\nit; both now run.\n\nThe existing hop-two check reads the route table and asserts it contains\n`ForwardSearch`. That was a reasonable call — an AppRoutes spec genuinely cannot\nrender hop two, because it mocks ./pages/Settings and settingsRouteElements\neagerly imports all 34 panels. But settingsRouteElements.test.tsx ALREADY renders\nthat table for real (it is how the retired screen-settings routes are covered),\nso the behaviour is reachable there for ~5s of runtime.\n\nAdds three cases in that file: the redirect lands on /connections, a query\nstring and fragment survive it, and nothing stray is invented when the link\ncarries neither.\n\nWhy both are worth keeping, measured rather than argued:\n\n - Wrapping the element in a fragment — <><ForwardSearch …/></> — is\n behaviour-preserving. The source assertion FAILS it\n ("expected '<Route path=\"integrations\" element={<>' to contain\n 'ForwardSearch'"); the rendered assertion correctly passes. So the source\n check is formatting-sensitive.\n - Reverting ForwardSearch -> Navigate is a real break. BOTH fail, the rendered\n one naming the defect directly:\n "expected '#/connections' to be '#/connections?tab=inbound#delivery-3'".\n\nRestored after each injection: 13 passed across both files, sources clean.\nAll runs through ~/tinyhuman/ci-slot.sh.\n

M3gA-Mind314cb80d01ca
diff --git a/app/src/components/settings/settingsRouteElements.test.tsx b/app/src/components/settings/settingsRouteElements.test.tsx
index b759ba3222..470677da1e 100644
--- a/app/src/components/settings/settingsRouteElements.test.tsx
+++ b/app/src/components/settings/settingsRouteElements.test.tsx
@@ -27,3 +27,48 @@ describe.each([
expect(screen.queryByText(/screen awareness debug/i)).not.toBeInTheDocument();
});
});
+
+/**
+ * Hop two of the `/webhooks` chain (#5908).
+ *
+ * /webhooks -> /settings/integrations AppRoutes.tsx
+ * /settings/integrations -> /connections here
+ *
+ * Both hops used a bare `<Navigate>`, which discards `search` and `hash`.
+ * Fixing only the first was not enough — the deep link reached
+ * `/settings/integrations` and was dropped here. This route is also reachable on
+ * its own by anyone holding an old Integrations settings link, so it needs the
+ * forwarding regardless of how they arrived.
+ *
+ * Rendered through the real route table rather than through `AppRoutes`, because
+ * every AppRoutes spec stubs `./pages/Settings` and the stub removes this hop.
+ */
+describe('retired /settings/integrations route', () => {
+ function renderAt(hash: string) {
+ window.location.hash = `#${hash}`;
+ render(
+ <HashRouter>
+ <Routes>
+ <Route path="/settings" element={<Outlet />}>
+ {settingsRouteElements()}
+ </Route>
+ </Routes>
+ </HashRouter>
+ );
+ }
+
+ it('redirects to /connections', async () => {
+ renderAt('/settings/integrations');
+ await waitFor(() => expect(window.location.hash).toBe('#/connections'));
+ });
+
+ it('carries a query string and a fragment through the redirect', async () => {
+ renderAt('/settings/integrations?tab=inbound#delivery-3');
+ await waitFor(() => expect(window.location.hash).toBe('#/connections?tab=inbound#delivery-3'));
+ });
+
+ it('invents no stray ? or # when the link carries neither', async () => {
+ renderAt('/settings/integrations');
+ await waitFor(() => expect(window.location.hash).toBe('#/connections'));
+ });
+});