const { container } = render(<MyComponent />); const inputEl = container.querySelector(`input[name="userName"]`);