Skip to content

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

fix(assistant-ui): handle missing thread data in desktop connection test

Steven Enamakeleb665e0f3040
diff --git a/app/src/components/assistant-ui/thread.tsx b/app/src/components/assistant-ui/thread.tsx
index ee0fd75c53..50e20b50c0 100644
--- a/app/src/components/assistant-ui/thread.tsx
+++ b/app/src/components/assistant-ui/thread.tsx
@@ -951,7 +951,7 @@ const Composer: FC<{
textbox?.removeAttribute('aria-label');
textbox?.removeAttribute('data-testid');
};
- }, []);
+ }, [messageInputLabel]);
// Set for as long as an IME composition is open. The gate is a ref rather
// than state because it is read from a microtask, not from a render.
diff --git a/app/src/components/desktop/DesktopConnectionPage.test.tsx b/app/src/components/desktop/DesktopConnectionPage.test.tsx
index fda296fee6..7175241495 100644
--- a/app/src/components/desktop/DesktopConnectionPage.test.tsx
+++ b/app/src/components/desktop/DesktopConnectionPage.test.tsx
@@ -60,9 +60,11 @@ describe('Desktop connection', () => {
});
renderWithProviders(<DesktopConnectionPage />);
- fireEvent.click(await screen.findByRole('button', { name: 'Enable' }));
+ fireEvent.click(await screen.findByRole('switch', { name: 'Enable' }));
expect(await screen.findByRole('alert')).toHaveTextContent('could not save setting');
- expect(screen.getByRole('button', { name: 'Enable' })).toBeInTheDocument();
+ // The switch stays off (unchecked) and still offers "Enable" since the
+ // write failed and the core-reported status never flipped to enabled.
+ expect(screen.getByRole('switch', { name: 'Enable' })).toBeInTheDocument();
expect(callCoreRpc).toHaveBeenCalledWith({
method: 'openhuman.desktop_set_enabled',
params: { enabled: true },