Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to focus out of an input in testing library

// selecting the input element
const input = getByTestId('input');
// typing into the element
await userEvent.type(input, 'text');
// focus out
fireEvent.focusOut(input);
 
PREVIOUS NEXT
Tagged: #focus #input #testing #library
ADD COMMENT
Topic
Name
1+6 =