fix(planner): open the places filters across the whole sidebar row

Hung off an icon near the end of the row, the category and rating lists ran
out of the sidebar and were cut off.
This commit is contained in:
Maurice
2026-10-14 10:45:10 +02:00
committed by Maurice
parent 341520f98b
commit 7c6b7622fc
2 changed files with 21 additions and 5 deletions
@@ -497,6 +497,20 @@ describe('Category filter dropdown', () => {
expect(screen.getByRole('button', { name: 'Museum' })).toHaveAttribute('aria-pressed', 'false');
});
it('FE-PLANNER-SIDEBAR-023b: the list opens across the whole filter row, not off its icon', async () => {
const user = userEvent.setup();
const cat = buildCategory({ name: 'Museum', color: '#3b82f6' });
render(<PlacesSidebar {...defaultProps} categories={[cat]} />);
await openCategories(user);
// Hung off an icon near the end of the row, the list ran out of the sidebar.
const list = screen.getByRole('button', { name: 'Museum' }).closest('.trek-popover-enter') as HTMLElement;
expect(list).toHaveClass('inset-x-0');
// Its positioning ancestor is the row that holds every filter.
let anchor = list.parentElement;
while (anchor && !anchor.classList.contains('relative')) anchor = anchor.parentElement;
expect(anchor).toContainElement(screen.getByRole('button', { name: 'Show' }));
});
it('FE-PLANNER-SIDEBAR-024: selecting a category filters places', async () => {
const user = userEvent.setup();
const cat = buildCategory({ name: 'Park', color: '#22c55e' });