render(<input aria-label="Name" defaultValue="Ana" />);
await user.type(screen.getByLabelText("Name"), "Bea");
'AnaBea'
The value is 'AnaBea'. user.type clicks the element and types at the end of the existing value, like a user would. The tempting answer 'Bea' is wrong, because typing does not replace the old text. To replace the value, call await user.clear(input) first, then type.
Read more
- user-event intro (https://testing-library.com/docs/user-event/intro)testing-library.com