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
Bring over DOM helper implementation. #258
Commits on Dec 15, 2017
-
Add initial implementations for
click
andfocus
.Original implementations are from https://github.com/cibernox/ember-native-dom-helpers and then modified: * Prefer default exports when reasonable * Remove manual run-wrapping when firing events (event listeners should already be run-wrapped). * Allow `focusin` to bubble in `focus` * Remove `context` arguments from helper methods.
-
Bring over
blur
implementation.Original implementations are from https://github.com/cibernox/ember-native-dom-helpers and then modified: * Added `fireEvent(element, 'focusout')` * Remove run wrapping
-
Add triggerEvent and triggerKeyEvent.
Original implementations are from https://github.com/cibernox/ember-native-dom-helpers and then modified: * Remove run wrapping
-
-
-
-
-
Ensure
focus
throws if invoked with unfocusable selector.Extract `_focus` helper method that can be used from `click` to avoid the assertion...
-
-
-
-
Even though https://w3c.github.io/uievents/#events-focusevent-event-order suggests that `focus` is always fired after `focusin`, after testing on Firefox, Chrome, and Safari (snippet below) this is not true. ```js let element = document.createElement('input'); ['mousedown', 'mouseup', 'click', 'focus', 'focusin'].forEach(type => { element.addEventListener(type, () => { console.log('event:', type); }); }); document.body.appendChild(element); ```
-
-
-
-
Create private
nextTick
utility.In order to ensure "time traveling" (sinon's fake timers, timecop, etc) we need to capture our `setTimeout` early during evaluation.
-
-
Add monkey patch for QUnit until qunit > 2.4.1 is released.
Brings in the changes from qunitjs/qunit@6a7910a.
-
-
* ensure always async * fire correct events (in order) To ensure correct event order, used the following snippet: ```js let element = document.createElement('input'); ['blur', 'focusout'].forEach(type => { element.addEventListener(type, () => { console.log('event:', type); }); }); document.body.appendChild(element); ```
-
-
-
Add and utilize
nextTickPromise
helper method.Prior to this change the `nextTick` would run and _might_ not be properly waited on by the returned `settle()` promise (though in practice `nextTick` did finish first). This updates to ensure that we only return `settled()` after the actual events have been fired.
-
-
-
-
-
-
Initial implementation of
fillIn
.Intial implementation from https://github.com/cibernox/ember-native-dom-helpers, but modified in a few ways: * Ensure validations are ran sync * Ensure events are triggered async * Remove run loop wrapping * Tweak error message and validation.
-
Mark internal helper functions as private.
Also add extra underscores :P
-
-
* Use `target` to mean `selectorOrElement` * Properly indicate optional params * Show default values
-
-
-
-
Avoid `setContext(this)` (use `setContext(localVariable)`) to make it much clearer what is going on.
-
-
-
-
-
-
-
-
-
-
-
-
Remove tests requiring
click
only wait for subset of settledness.These tests previously used a sync version of click that allowed `settled` to be tested with _only_ waiting for some portions of settledness. When the tests were converted to use the new public version of `click` the test began failing (because `click` doesn't kick off until the next tick of the event loop, so `settled` resolves immediately).
-
-
-
-
-
-
-
-