From 931e0e22c75fa26c9e0d7f05966b6ed914aa40ca Mon Sep 17 00:00:00 2001 From: Hypatia May Date: Thu, 23 Jul 2026 14:02:37 +0800 Subject: [PATCH] test(ui-sidebar): cover expanded search control --- packages/client/ui-sidebar/tests/sidebar-root.spec.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/client/ui-sidebar/tests/sidebar-root.spec.tsx b/packages/client/ui-sidebar/tests/sidebar-root.spec.tsx index b0e8a9f769..197dbe2b9a 100644 --- a/packages/client/ui-sidebar/tests/sidebar-root.spec.tsx +++ b/packages/client/ui-sidebar/tests/sidebar-root.spec.tsx @@ -205,6 +205,14 @@ describe('SidebarRoot', () => { } }) + it('expanded search control focuses the field without toggling the sidebar', () => { + const { onToggleSidebar } = mount(...projectData()) + const input = screen.getByPlaceholderText('Search name, keywords...') + act(() => { fireEvent.click(screen.getByLabelText('Search sessions')) }) + expect(document.activeElement).toBe(input) + expect(onToggleSidebar).not.toHaveBeenCalled() + }) + it('the search query survives a collapse/expand round trip', () => { vi.useFakeTimers() try {