forked from emberjs/ember.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX beta] revert jquery-less pendingRequest event handling
In general,Ember's testing system leverages `ajaxSend` and `ajaxComplete` events to know when `jQuery.ajax` requests are pending (and it should therefore "pause settledness" of the testing helpers like `click` / `andThen` / etc). In the Ember 3.1 cycle Ember changed from using `jQuery.on` to `document.addEventListener` to subscribe to these events. Unfortunately, `jQuery.ajax` **does not** trigger listeners added in this way (we would have had to do `document.onajaxSend = function() { /* stuff here */ }`). The result of this change is that "normal" acceptance testing helpers will _no longer_ be able to detect and wait for pending `jQuery.ajax`. So, for example, you might expect that given the following ```js await click('#some-selector'); assert.equal( $('#something-that-should-exist-after-an-ajax-call').text(), 'hi' ); ``` the click helper would wait until `jQuery.ajax` calls were settled before the assertion, but prior to the changes in this commit the promise returned by `click` would **not** wait until the `jQuery.ajax` request was completed and therefore the assertion would fail. --- This commit reverts the changes to use `document.addEventListener` back to using `jQuery.on` directly when `jQuery` is available. Many bothans died to bring us this information. 😭 😢 :crying_cat: Paired with @rwjblue to resolve this issue.
- Loading branch information
1 parent
f99538d
commit 8609228
Showing
3 changed files
with
21 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters