title: Testing form input in jest and enzyme
body: <p>I've been working with tests in react, and I'm in a trouble with testing form inputs.</p>
  
  <p>FormInput component in register</p>
  
  <pre><code> &lt;FormInput
            data-test="form-input"
            className={`${errors.username &amp;&amp; "input-error"}`}
            name="username"
            type="text"
            ariaLabel="Username" placeholder="Username"
            value={values.username}
            onChange={handleChange}
            onBlur={handleBlur}
            icon={
              &lt;FaUser size={"3rem"} color={theme.colors.formInputBorderColor} /&gt;
            }
          /&gt;
  </code></pre>
  
  <p>This is FormInput component </p>
  
  <pre><code>export const FormInput = React.memo(({name,type,placeholder,value,onChange,onBlur,icon,className,ariaLabel}) =&gt; {
  
    return (
        &lt;&gt;
        &lt;Input className={className} name={name} type={type} placeholder={placeholder} value={value} onChange={onChange} onBlur={onBlur} aria-label={ariaLabel}/&gt;
        {icon}
  
        &lt;/&gt;
    )
  })
  </code></pre>
  
  <p>The test lines is like this as well. I have 3 FormInput in register, so I've used "at(0)"</p>
  
  <pre><code>it("Testing input events",() =&gt; {
  
        const component = wrapper.find("input").at(0);
        console.log(component.debug())
         //for selecting one input
         component.simulate("change",{
          target:{value:"username"}
         })
  
         expect(component.props().value).toEqual("username")
      })
  </code></pre>
  
  <p>And the result is </p>
  
  <pre><code> Expected: "username"
      Received: ""
  
        54 |        })
        55 | 
      &gt; 56 |        expect(component.props().value).toEqual("username")
           |                                        ^
        57 |     })
        58 |     it("Should render one form", () =&gt; {
        59 |       const component = findByTestAtrr(wrapper, "form");
  </code></pre>
  
  <p>What should I exactly do ? Thanks</p>