test(ui-sidebar): cover expanded search control

This commit is contained in:
Hypatia May
2026-07-23 14:02:37 +08:00
parent fde4f8e502
commit 931e0e22c7

View File

@@ -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 {