expect(input).toHaveValue('ana@x.com')toHaveValue is right, because it reads the current value of the form control. The tempting toHaveAttribute('value', ...) option is wrong. The value attribute holds the initial value, not what the user typed. toHaveTextContent is wrong because inputs have no text content. toBeInTheDocument expects an element, not a string.
Read more
- About queries (https://testing-library.com/docs/queries/about)testing-library.com