Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to clear an input in testing library

const input = getByTestId('input');

// clearing the input
await userEvent.clear(input);
// focusing out of the input (if required)
fireEvent.focusOut(input);
 
PREVIOUS NEXT
Tagged: #clear #input #testing #library
ADD COMMENT
Topic
Name
3+8 =