test: NameItemEditor component - Focussing of Input element after click

This commit is contained in:
2025-12-02 10:39:40 +01:00
parent 1158c88d43
commit a50c5243a5

View File

@@ -18,7 +18,13 @@ describe('NameItemEditor - Funktionalität', () => {
onDelete onDelete
}; };
test.todo('FocusIn nach Klick auf edit'); test('Focus Input nach Klick auf edit', async () => {
render(NameItemEditor, { props: baseProps });
await fireEvent.click(screen.getByTestId('edit-button'));
const input = screen.getByTestId('test-input');
expect(document.activeElement).toBe(input);
});
it('zeigt initial Edit/Delete Buttons und aktuellen Namen', () => { it('zeigt initial Edit/Delete Buttons und aktuellen Namen', () => {
render(NameItemEditor, { props: baseProps }); render(NameItemEditor, { props: baseProps });