aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* Docs: Change a few most common domains from HTTP to HTTPSMichał Gołębiowski-Owczarek2024-04-2610-21/+21
| | | | | Also, update a few stale URLs to what they redirect now to. Closes gh-2244
* Tests: Skip a problematic keyboard test in IE with jQuery 3.6Michał Gołębiowski-Owczarek2024-04-121-1/+7
| | | | | | jQuery 3.6 has issues with focus handling in IE which breaks this test. The issues were fixed in jQuery 3.7, so we just accept them here. Closes gh-2231
* Tests: Increase robustness of a draggable `revert` testMichał Gołębiowski-Owczarek2024-04-121-2/+3
| | | | | | | | One of the changes is increasing `revertDuration` from 200 to 300. For some reason, when jQuery 3.1 is used in an iframe (which TestSwarm uses) the timings are lower than expected and `setTimeout` too slow and the check for animation happens too late. Closes gh-2230
* Tests: Workaround a jQuery 1.8 issue with one dialog testMichał Gołębiowski-Owczarek2024-04-121-0/+18
| | | | | | | The test "#8958: dialog can be opened while opening" had special behavior in jQuery 1.8 and the patch from commit 7adb13ac7c30a7ba33f1db256952be77b9e7a310 broke those assumptions. Adjust the test so that it passes again. Closes gh-2229
* Tests: replace grunt-contrib-qunit with jQuery test runnerTimmy Willison2024-03-291-1/+1
| | | | | - add filestash workflow Close gh-2221
* Tests: Fix tests with the Git Core buildMichał Gołębiowski-Owczarek2024-03-261-1/+2
| | | | | | jQuery PR jquery/jquery#5452 removed special handling of boolean attributes. Thankfully, this only broke a single jQuery UI test. Closes gh-2220
* Build: Add jQuery 3.7.0Michał Gołębiowski-Owczarek2023-05-121-0/+1
|
* Tests: Make resizable tests a bit more forgivingMichał Gołębiowski-Owczarek2023-05-101-6/+16
|
* Tests: Workaround a dialog test issue by a proper cleanupMichał Gołębiowski-Owczarek2023-05-101-2/+9
| | | | | The `#favorite-animal` focus & blur handlers used to not be cleaned up after the test automatically, leading to issues with some jQuery versions.
* Tests: Fix selectmenu width tests in Firefox with jQuery 3.0 & 3.1Michał Gołębiowski-Owczarek2023-05-101-2/+3
| | | | | | | | jQuery 3.0 & 3.1 used `getBoundingClientRect()` in its `width`/`height` calculations and that causes minor differences in fractional width computations. Allow a tiny delta in tests to fix those tests breaking in Firefox. Ref jquery/jquery#3561 Closes gh-2159
* Selectmenu: Fix selecting options following hidden onesMichał Gołębiowski-Owczarek2023-05-101-3/+62
| | | | | | | | | | | Change a2b25ef6caae3e1a272214839b815a6387618124 made options with the `hidden` attribute skipped when rendering. However, that makes indexes misaligned with native options as hidden ones maintain their index values. Instead, don't skip hidden options but add the `hidden` attribute to the respective jQuery UI elements as well. Fixes gh-2082 Closes gh-2144 Ref a2b25ef6caae3e1a272214839b815a6387618124
* Build: Add jQuery 3.6.4, update Migrate to 3.4.1Michał Gołębiowski-Owczarek2023-05-101-1/+1
| | | Closes gh-2161
* Build: Fork vendors to remove QUnit deprecated API usageMichał Gołębiowski-Owczarek2023-05-1027-60/+86
| | | | | | | | | | | | Changes: * add `tests/lib/vendor/**/*` to `.eslintignore` * move `qunit-composite` to `tests/lib` so that we can modify it * move `qunit-assert-classes` to `tests/lib` so that we can modify it * move `qunit-assert-close` to `tests/lib` so that we can modify it * replace `assert.push` with `assert.pushResult` * remove usage of `QUnit.extend` Closes gh-2157
* Tests: Switch from QUnit.jsDump to QUnit.dumpMichał Gołębiowski-Owczarek2023-05-101-1/+1
| | | | | | `QUnit.jsDump` was renamed to `QUnit.dump` in QUnit 2.0. Ref gh-2157
* Tests: Fix tooltip tests by destroying tooltipsMichał Gołębiowski-Owczarek2023-05-105-5/+34
| | | | | | | Some tests were not properly destroying tooltips which made tests start to fail with the new QUnit. Ref gh-2157
* Demos:Tests: Avoid self-closing HTML tagsMichał Gołębiowski-Owczarek2023-05-102-14/+14
| | | | | | | | | Self-closing tags are reported by newer versions of the htmllint Grunt plugin. They also don't make sense in our HTML files since they are not XHTML-compliant and they run in HTML mode anyway. Ref gh-2157
* Tests: Test only valid values for Datepicker defaultDate, min/maxDateKenneth DeBacker2023-03-301-14/+14
| | | | | | | The docs say that valid periods when using string value and period pairs as relative dates are "y", "m", "w", and "d" https://api.jqueryui.com/datepicker/ Closes gh-2143
* Build: Add jQuery 3.6.1-3.6.3, update Migrate to 3.4.0Michał Gołębiowski-Owczarek2023-01-151-1/+1
|
* Resizable: Fix resizing of elems with `box-sizing: border-box`Matías Cánepa2022-10-101-0/+26
| | | | Fixes gh-1979 Closes gh-2012
* Checkboxradio: Don't re-evaluate text labels as HTMLMichał Gołębiowski-Owczarek2022-07-143-0/+87
| | | | | | | | | | | | | If you generate a Checkboxradio from a checkbox/radio with a label that contains encoded HTML, e.g. `<em>test</em>` this will work fine at first. If, however a refresh is triggered on that instance (explicitly or e.g. by turning it into a `Controlgroup`), the previously escaped HTML will now be evaluated. If the label was created based on some user input, this could lead to unexpected code execution even though the initial output was escaped. Fixes gh-2101 Closes gh-2102
* Widget: Optimize attachment of the _untrackClassesElement listenerMichał Gołębiowski-Owczarek2022-01-153-0/+105
| | | | | | | | | | | | | | | jQuery UI 1.13.0 changed the logic attaching the `_untrackClassesElement` listener in the `_classes` widget method; one of the side effects was calling `this._on` for each node that needed the listener. That caused a severe performance degradation for large comboboxes as each `_on` jQuery UI call causes a jQuery `add` call that calls Sizzle's `uniqueSort` underneath. Instead, collect the nodes that need the listener and then, outside of the loop, create a jQuery object out of them and attach the listener once. That's still slower than the jQuery 1.12 version but only slightly: 936 ms to 1.03s on a very large list on a recent MacBook Pro, compared to ~30 seconds before this patch. Fixes gh-2014 Closes gh-2037
* Autocomplete: Rewrite with a delay instead of appending the live regionBen Mullins2022-01-051-34/+46
| | | | | | | | | This fixes the issue caused by https://bugs.jqueryui.com/ticket/9357. We now empty the live region instead of appending to it, and we do so after a brief timeout so the live region isn't updated on every mousemove event or when quickly traversing through options. Fixes gh-2002 Closes gh-2031
* Widget: Make contextless widget construction workMichał Gołębiowski-Owczarek2021-11-191-0/+12
| | | | | | | | | | | | | | Due to the fact the widget factory code is now in strict mode, the check for being called without using the `new` keyword started breaking if you save the widget constructor to a variable before calling it: ```js var customWidget = $.custom.customWidget; customWidget( {}, elem ); ``` as then `this` is undefined and checking for `this._createWidget` crashes. Account for that with an additional check. Fixes gh-2015 Closes gh-2019
* Sortable: Fix positioning when moving a Draggable item into a SortableMichał Gołębiowski-Owczarek2021-11-151-0/+57
| | | | | | | | | PR gh-1793 removed setting `this.offset.parent` in the Draggable `refreshPositions` method which broke position calculations when moving a Draggable item into a connected Sortable. restore that assignment. Ref gh-1793 Fixes gh-2001 Closes gh-2009
* Sortable: Allow 0-height containers to be sortable as in 1.12.1Michał Gołębiowski-Owczarek2021-11-081-0/+53
| | | | | | | | | Note that container specific events will not fire when the dragged element is interacting with zero height containers. Fixes gh-1998 Closes gh-2008 Co-authored-by: A. Wells <borgboyone@users.noreply.github.com>
* Tooltip: Don't crash on empty contentJosep Sanz2021-11-081-0/+70
| | | | | | | | | | | | | | | Commit 1f2011ece removed a `try-catch` around triggering the `remove` handlers in the `jQuery.cleanData` override. The `try-catch` was meant for old IE but it was also catching an error coming from the tooltip `remove` handler depending on being able to find a relevant tooltip. The `_find` method returns `null`, though, when the tooltip cotent is empty. Instead of restoring the `try-catch`, handle the `null` case in the `remove` handler. Fixes gh-1990 Closes gh-1994 Co-authored-by: Claas Augner <github@caugner.de> Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
* Build: Migrate from JSHint & JSCS to ESLintMichał Gołębiowski-Owczarek2021-06-0796-75/+217
| | | | | Fixes #15393 Closes gh-1958
* Datepicker: Improve callbacks test for onUpdateDatepickerPatrick McKay2021-05-211-2/+7
| | | | Make sure the custom element added by the onUpdateDatepicker callback still exists and is not duplicated after calling refresh and setDate.
* Datepicker: Add option for onUpdateDatepicker callbackPatrick McKay2021-05-211-2/+18
| | | | | | Add a new option named onUpdateDatepicker that allows a custom callback to be provided. If provided, the callback is called at the end of $.datepicker._updateDatepicker.
* All: Drop $.ui.escapeSelector in favor of $.escapeSelectorMichał Gołębiowski-Owczarek2021-05-141-8/+0
| | | | Fixes #14991 Closes gh-1957
* Datepicker: Make sure text option are text, shorten HTML stringsMichał Gołębiowski-Owczarek2021-05-121-0/+51
| | | | | | | | Instead of using enormous HTML strings, various elements are now constructed using jQuery APIs. This makes it more obvious user-provided data is used correctly. Fixes #15284 Closes gh-1953
* Position: Make sure `of` is treated as a CSS selectorMichał Gołębiowski-Owczarek2021-05-041-1/+19
| | | Closes gh-1955
* Datepicker: Make sure altField is treated as a CSS selectorMichał Gołębiowski-Owczarek2021-05-041-2/+20
| | | Closes gh-1954
* Tests: Accept delayed focusout in IE with jQuery 1.8Michał Gołębiowski-Owczarek2021-04-161-2/+13
| | | | | | In IE with jQuery 1.8 focusout may not happen immediately so some checks need to be done later. Closes gh-1952
* Tests: Fix the "dialog: core: focus tabbable" test in IEMichał Gołębiowski-Owczarek2021-03-161-6/+26
| | | | | | | | | | | | | In IE in jQuery 3.4+ a sequence: ```js $( inputNode ).trigger( "focus" ).trigger( "blur" ).trigger( "focus" ); ``` doesn't end up with a focused input. However, in this test we only want to check that the last focused input receives the focus back when `_focusTabbable()` is called which in reality doesn't happen so quickly so let's avoid the issue by waiting a bit. Ref jquery/jquery#4856 Closes gh-1951
* Tests: Make some number comparisons less strictMichał Gołębiowski-Owczarek2021-03-092-6/+24
| | | | | | | | | | Some of the APIs return fractional values in newer jQueries, making comparisons sometimes not being 100% accurate. Allow some delta. This is similar to what was already done in 98b539171b6e805fa79346a5e9896865e5213b9c but a few cases affecting IE and/or Edge Legacy were missed. Closes gh-1947
* Build: Add jQuery 3.6.0, update Migrate from 3.3.1 to 3.3.2Michał Gołębiowski-Owczarek2021-03-091-0/+1
| | | Closes gh-1948
* Focusable: Fix handling of `visibility: collapse`Paul Capron2020-10-142-1/+13
| | | | | | | | | | | | | | "collapse" is similar to "hidden", with a slight difference in the case of tr/tbody/td/colgroup elements. See https://www.w3.org/TR/CSS22/visufx.html#visibility See https://www.w3.org/TR/CSS22/tables.html#dynamic-effects See https://developer.mozilla.org/en-US/docs/Web/CSS/visibility#Table_example "visibility: collapse" elements are always not focusable, though. Commit d3025968f34 introduced a regression by testing with `!== "hidden"` instead of `=== "visible"`. Closes gh-1843
* Tests: Accept a small difference of animated width/heightMichał Gołębiowski-Owczarek2020-07-231-2/+4
| | | | | | | | | | | | | jQuery 3.2 & newer have a different animation logic and the animated elements width/height differ from the starting ones even at the beginning of the animation. The point of the assertions checking that they're identical was to ensure bug #5245 is fixed; that issue manifested by a big jump to half the element size. To test for that, it's enough to check that the first obtained values are close to the original ones. This makes effects tests pass in all supported jQuery versions. Closes gh-1928 Ref #5245
* Tests: Skip a scrollbar test in jQuery 3.2Michał Gołębiowski-Owczarek2020-07-231-1/+7
| | | | | | | | | | | jQuery 3.2 incorrectly handle scrollbars in WebKit/Blink-based browsers. This is fixed in version 3.3, see https://github.com/jquery/jquery/issues/3589. As the data here comes from jQuery directly and the changes to fix it are non-trivial: https://github.com/jquery/jquery/pull/3656, just accept that scrollbar data in this jQuery version is inaccurate. Closes gh-1927 Ref jquery/jquery#3589 Ref jquery/jquery#3656
* Tests: Clear the timers queue in an animateClass testMichał Gołębiowski-Owczarek2020-07-231-3/+2
| | | | | | jQueries older than 1.11 or 2.1 were leaving a timer in the queue which could then influence other tests. Closes gh-1926
* All: Drop support for jQuery 1.7Michał Gołębiowski-Owczarek2020-07-223-18/+11
| | | Closes gh-1923
* Tests: Ensure no timers are running at the end of each test (#1920)Michał Gołębiowski-Owczarek2020-05-1690-171/+324
| | | | | | | | | | | | | This helps fix issues that make tooltip tests sometimes fail when run against jQuery 3.2 or newer due to timing differences. Details: * Add the `moduleAfterEach` function ensuring no timers are running. * Attach this function via `common.testWidget`. * Attach this function to most test suites. * Add a tooltip test helper cleaning up leftover timers. * Rename legacy `setup`/`teardown` hooks to `beforeEach`/`afterEach`. Closes gh-1920
* All: Resolve most jQuery Migrate warningsMichał Gołębiowski-Owczarek2020-05-164-5/+5
| | | Closes gh-1919
* Tests: Solve a frequent race condition in tests in Chrome/SafariMichał Gołębiowski-Owczarek2020-05-161-4/+10
| | | Closes gh-1916
* Build: Add jQuery 3.5.0 & 3.5.1Michał Gołębiowski-Owczarek2020-05-161-0/+1
| | | Closes gh-1915
* Datepicker: Fixed current instance memory leak and added unit testcasesjigar gala2020-03-231-2/+11
|
* All: Remove usage of jQuery positional selectorsMichał Gołębiowski-Owczarek2020-01-2214-124/+143
| | | | | | | | | | | | | | | | | jQuery positional selectors () have been deprecated in [jQuery 3.4.0](https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/) and they'll be removed in jQuery 4.0.0. This PR removes their usage. Most of the changes were possible without changing public API. However, dropping `:even` usage required a change to the [`header` option](https://api.jqueryui.com/accordion/#option-header) of the accordion widget. I made it an optional function; this will need to be documented. The polyfill for `.even()` & `.odd()` is added for jQuery <3.5.0. There was no usage of the :odd selector in the code but the `.odd()` method is also polyfilled for completeness. Closes gh-1904
* All: Migrate away from deprecated/removed Core APIsMichał Gołębiowski-Owczarek2019-12-0811-39/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary of the changes: * Build: Add jQuery 3.2.0-3.4.1 to versions UI can be tested against * Build: Load jQuery & Migrate via HTTPS * Build: Add package-lock.json to .gitignore * Build: Update jQuery Migrate from 3.0.0 to 3.1.0 * Build: Allow to run tests against jQuery 3.x-git * Build: Fix formatting according to JSCS rules * Build: Disable JSCS for the inlined jQuery Color * All: Switch from $.isArray to Array.isArray (jQuery.isArray will be removed in jQuery 4.0) * All: Switch from `$.isFunction( x )` to `typeof x === "function"` (jQuery.isFunction will be removed in jQuery 4.0) * All: Inline jQuery.isWindow as it'll be removed in jQuery 4.0 * Effects: Fix a timing issue in a variable declaration. Previously, a jQuery object was created, chained & assigned to a variable that was then accessed in a callback used inside of this chained definition. Due to a timing difference in when the callback fired for the first time in latest jQuery master, it was being called before the variable was defined. * Tests: Make dialog & draggable unit tests less strict (newest jQuery returns fractional results in some cases, making comparisons fail when there's a tiny difference) * All: Migrate from $.trim to bare String.prototype.trim (jQuery.trim will be deprecated in jQuery 3.5) Closes gh-1901
* Menu: Ignore mouse events triggered due to page scrollingScott González2017-05-022-4/+4
| | | | | Fixes #9356 Closes gh-1806