mzgoddard / preact-render-spy

Render preact components with access to the produced virtual dom for testing.
https://www.npmjs.com/package/preact-render-spy
ISC License
178 stars 24 forks source link

.text() behaviour for input elements #79

Open fokusferit opened 6 years ago

fokusferit commented 6 years ago

I just wanted to ask, if the behavior of text() not working with input elements is intended?

For example if we have a component with this output:

"preact-render-spy (1 nodes)
-------
<td class="column-text-centered input_price">
  <div>
    <input
      type="text"
      value="5,00"
      onBlur={[Function debounced]}
      class="defaultInputStyle defaultUnderline customPriceInput"
     />
    <span>EUR</span>
  </div>
</td>
"

a .text() call on .input_price will only return the span elements text but I would "expect" that it would also return the value of input? Technically it is not a plain Text Dom element but I would like to ask if it would make sense to include input (maybe also other input elements) to the .text() functionality?

gnarf commented 6 years ago

hrm

Do we know what Enzyme does in this case? I'd take my answer from them?