feat(tag-typeahead): tree-aware results — expand children & surface ancestor path #251

Merged
marcel merged 6 commits from feat/issue-250-tag-typeahead-tree-aware into main 2026-04-17 12:25:55 +02:00
Showing only changes of commit b01761d800 - Show all commits

View File

@@ -255,6 +255,18 @@ describe('TagInput autocomplete', () => {
await waitForFetch();
await expect.element(page.getByRole('listbox')).toBeInTheDocument();
});
it('selects a suggestion via Enter when allowCreation=false', async () => {
mockFetchWithTags(['Familie']);
render(TagInput, { tags: [], allowCreation: false });
const input = page.getByRole('textbox');
await input.fill('Fa');
await waitForFetch();
await userEvent.keyboard('{ArrowDown}'); // index 0 → Familie
await userEvent.keyboard('{Enter}');
await expect.element(page.getByText('Familie')).toBeInTheDocument();
await expect.element(input).toHaveValue('');
});
});
// ─── Tree-aware ordering ──────────────────────────────────────────────────────