Make acceptance helpers fire native events instead of jQuery ones.#12575
Conversation
6c9ca86 to
ccadf06
Compare
|
There is some funkiness going on with the Wut? |
Yep. |
|
|
b10a790 to
565d169
Compare
|
@rwjblue I managed to remove al reliance in jquery except this line: https://github.com/cibernox/ember.js/blob/make_acceptance_helpers_fire_native_evets/packages/ember-testing/lib/helpers.js#L108 I tried everything but it couldn't find a way of firing a focusin event if the browser doesn't has the focus. I think that is the browser itself the one that is swallowing any event whose type is |
58c9400 to
51c3de0
Compare
f2917fd to
9c5f719
Compare
|
I've rebased this. The only jquery event I wasn't able to replace was triggering |
We have had lots of issues with this event on FF... |
|
Do we want to treat this as a bugfix or a new feature? |
|
Not sure. I'd say bugfix because firing jquery events instead of real events is being "less real" than we should be. That said, I fear that this can be backwards incompatible in some weird edge case I haven't predicted, but it's just me being pessimistic. I'd try and see if someone reports. |
I like this PR alot, but I share this concern. Which made me think, what if it was treated as a feature instead. It is possible that |
|
I like the idea of it being in a feature flag (and therefore easier to back out if we have to), but I would like to land it and then subsequently enable the feature nearly immediately (to let folks bang on it for a full canary and beta cycle). @cibernox - Do you mind feature flagging it? |
ya good point. |
9c5f719 to
a706765
Compare
|
Added a |
|
@cibernox nice! |
a706765 to
835041e
Compare
|
Any idea why the |
|
Restarted them
|
835041e to
db9bebb
Compare
|
Seems to fail consistently, but the output doesn't give me any clue of why |
6700fd0 to
87d0e28
Compare
|
Build is green now, but don merge yet, I will implement some suggestion by @runspired in slack tonight/tomorrow |
c09d649 to
14df566
Compare
|
Ready to merge if build turns out green again. |
2c146b1 to
d2d7983
Compare
Goal: To fire events in relatively accurate and cross-browser way. Simulate real events in pure javascript accurately is nearly impossible, but this is a best effort. This fires 3 different kind of events: - MouseEvents: click, dbclick, mousedown, mouseup, mouseenter, mouseleave, ... - KeyEvents: keydown, keypress and keyup - Events: Anything else. This should probably cover 99% of use cases.
d2d7983 to
3fbdcb7
Compare
…native_evets Make acceptance helpers fire native evets instead of jQuery ones.
Needed in reaction to emberjs/ember.js#12575
Following issue #12569
Goal: To fire events in relatively accurate and cross-browser way.
Simulate real events in pure javascript accurately is nearly impossible, but
this is a best effort. This fires 3 different kind of events:
This should probably cover 99% of use cases.
Caveats found:
I've only encountered 2 failing tests after this refactor, both related to the same problem:
It turns that
keyCodeis a reserved property that only works with keyboardEvents, so although the event has this property mixed, the wrapped jquery event does not copy that property if the original event is not a keyboard event.Seems very reasonable and probably that test was a bad example.