-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FillIn acceptance helper works only on the first matched input #14018
Comments
Ok so the issue seems to be that the
Question is what's the expected behavior, to only work on the first element or to work on all found elements? |
@piotrpalek I'm curious if you are more explicit with the selector you use with See: this twiddle it uses a more specific selected to I think that the expectation is that the I do not think this is a bug. |
@pixelhandler being able to make the selector more specific isn't the issue. The issue is that the behavior is inconsistent when having a selector that matches multiple inputs. It should either only work for the first element in case of multiple inputs, or work consistently for all of them. Right now when you try to As for the question if it should work for multiple elements. I think that if the guides say that it expects a selector for the input, without specifying that it will only work for the first matched element, then it would be expected that it can work on all of the elements that the selector finds, not only for the first item. But that's something that can be agreed on. |
Currently, `fillIn` sets the new value to all matches, though the events are only fired for the first one, making Ember only aware of that one. This can cause a problem while trying to _debug_ a test. Fixes emberjs#14018
Thank you, @piotrpalek! The PR has just been merged and there is a comment in the Grand Testing Unification RFC you might be interested in. Thank you! |
@Serabe np 👍 |
Currently, `fillIn` sets the new value to all matches, though the events are only fired for the first one, making Ember only aware of that one. This can cause a problem while trying to _debug_ a test. Fixes emberjs#14018
Currently, `fillIn` sets the new value to all matches, though the events are only fired for the first one, making Ember only aware of that one. This can cause a problem while trying to _debug_ a test. Fixes emberjs#14018
I tried to
fillIn
multiple inputs in an acceptance test with one selector. So let's say my template was:And I was using
fillIn
like this:fillIn('input', 'someval')
The result would be that visually it would seem as if both inputs are filled in with the same value (html was updated), but the data binding would only be updated on
someVal
.Replicated here: https://ember-twiddle.com/63d30b6cde4d82491c0def9bcc36ef28
(sidenote: I couldn't use Ember 2.7 due to a twiddle bug, but the same thing is happening in an app using Ember 2.7)
The text was updated successfully, but these errors were encountered: