Skip to content

Commit

Permalink
fix: Contains should use synthetic -jquery over jquery import (#553)
Browse files Browse the repository at this point in the history
Co-authored-by: Ruslan Hrabovyi <[email protected]>
  • Loading branch information
Alonski and ro0gr authored Oct 18, 2021
1 parent efdccd3 commit 5518a30
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions addon-test-support/properties/contains.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { assign, every } from '../-private/helpers';
import { A } from '@ember/array';
import { assign } from '../-private/helpers';
import { findMany, findOne } from '../extend';
import $ from 'jquery';
import $ from '-jquery';

/**
* Returns a boolean representing whether an element or a set of elements contains the specified text.
Expand Down Expand Up @@ -101,8 +102,8 @@ export function contains(selector, userOptions = {}) {

let elements = options.multiple ? findMany(this, selector, options) : [findOne(this, selector, options)];

return every($(elements), function(element) {
return element.text().indexOf(textToSearch) >= 0;
return A(elements).every(function(element) {
return $(element).text().indexOf(textToSearch) >= 0;
});
};
}
Expand Down

0 comments on commit 5518a30

Please sign in to comment.