fix(sessions): render picker views inside matching tab panels

This commit is contained in:
Chris Scott committed 2026-10-15 17:32:19 +00:00
1 parent c41eff304c
commit 1270e4b52e
2 files changed
+25 -4

No files matched your search

@@ -500,6 +500,20 @@ describe('SessionPickerDialog', () => {
expect(combobox()).toHaveAttribute('placeholder', 'Search sessions...')
})
it('exposes a tabpanel labelled by the active tab and swaps panels on tab switch', async () => {
renderPicker()
const sessionsPanel = screen.getByRole('tabpanel', { name: 'Sessions' })
expect(sessionsPanel).toHaveAttribute('data-state', 'active')
expect(screen.queryByRole('tabpanel', { name: 'Projects' })).not.toBeInTheDocument()
openProjectsTab()
const projectsPanel = await screen.findByRole('tabpanel', { name: 'Projects' })
expect(projectsPanel).toHaveAttribute('data-state', 'active')
expect(screen.queryByRole('tabpanel', { name: 'Sessions' })).not.toBeInTheDocument()
})
it('lists repos in the projects tab and opens the cursor repo on Enter', async () => {
mocks.repos = [repo(1, 'alpha', '/w/a'), repo(2, 'beta', '/w/b')]
const { onSelectRepo } = renderPicker()