diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2024-05-10 14:45:59 +0200 |
---|---|---|
committer | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2024-05-15 00:38:40 +0200 |
commit | 9887579b61972647f1478e64c5d7987f9d9cb039 (patch) | |
tree | c592a65dd9a8f9a6a7a3a31892eec299e1799a80 /tests/unit/accordion | |
parent | f90eab84b5e9a65ce62f18106e3db0ee316913f6 (diff) | |
download | jquery-ui-9887579b61972647f1478e64c5d7987f9d9cb039.tar.gz jquery-ui-9887579b61972647f1478e64c5d7987f9d9cb039.zip |
All: Stop relying on jquery-patch.js internally, add tests
Avoid relying on jQuery patches. Instead:
* use `CSS.escape` instead of `jQuery.escapeSelector`
* use `.filter()` with a proper handler instead of `.even()`
Keep `jquery-patch.js` for backwards compatibility, though.
Also, add tests for jquery-patch.
Ref gh-2249
Diffstat (limited to 'tests/unit/accordion')
-rw-r--r-- | tests/unit/accordion/common.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/unit/accordion/common.js b/tests/unit/accordion/common.js index 926d5d9c3..4f1ba7e5d 100644 --- a/tests/unit/accordion/common.js +++ b/tests/unit/accordion/common.js @@ -16,7 +16,17 @@ common.testWidget( "accordion", { disabled: false, event: "click", header: function( elem ) { - return elem.find( "> li > :first-child" ).add( elem.find( "> :not(li)" ).even() ); + return elem + .find( "> li > :first-child" ) + .add( + elem.find( "> :not(li)" ) + + // Support: jQuery <3.5 only + // We could use `.even()` but that's unavailable in older jQuery. + .filter( function( i ) { + return i % 2 === 0; + } ) + ); }, heightStyle: "auto", icons: { |