-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove jQuery usage from ember-testing
- Loading branch information
1 parent
860f334
commit 6e00ef3
Showing
8 changed files
with
12 additions
and
1,922 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,10 @@ | ||
/** | ||
@module ember | ||
*/ | ||
import { get } from '@ember/-internals/metal'; | ||
import { assert } from '@ember/debug'; | ||
import { jQueryDisabled } from '@ember/-internals/views'; | ||
|
||
/** | ||
Finds an element in the context of the app's container element. A simple alias | ||
for `app.$(selector)`. | ||
Example: | ||
```javascript | ||
var $el = find('.my-selector'); | ||
``` | ||
With the `context` param: | ||
```javascript | ||
var $el = find('.my-selector', '.parent-element-class'); | ||
``` | ||
@method find | ||
@param {String} selector jQuery selector for element lookup | ||
@param {String} [context] (optional) jQuery selector that will limit the selector | ||
argument to find only within the context's children | ||
@return {Object} DOM element representing the results of the query | ||
@public | ||
*/ | ||
export default function find(app, selector, context) { | ||
if (jQueryDisabled) { | ||
assert( | ||
'If jQuery is disabled, please import and use helpers from @ember/test-helpers [https://github.com/emberjs/ember-test-helpers]. Note: `find` is not an available helper.' | ||
); | ||
} | ||
let $el; | ||
context = context || get(app, 'rootElement'); | ||
$el = app.$(selector, context); | ||
return $el; | ||
export default function find() { | ||
assert( | ||
'Please import and use helpers from @ember/test-helpers [https://github.com/emberjs/ember-test-helpers]. Note: `find` is not an available helper.' | ||
); | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.