feat(tag-typeahead): tree-aware results — expand children & surface ancestor path #251
@@ -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 ──────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user