aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Menu: Don't focus dividers when wrapping via keyboard navigationScott González2017-05-022-0/+32
| | | | | Fixes #15157 Closes gh-1804
* Button: Fix backcompat when called on collection of mixed elementsAlexander Schmitz2017-05-022-0/+26
| | | | | Fixes #15109 Closes gh-1808
* Labels: Handle empty setsScott González2017-05-021-1/+3
| | | | Fixes #15184
* Menu: Close menus immediately on selection or click outsideScott González2017-04-251-1/+3
| | | | | Fixes #15034 Closes gh-1807
* Widget: Handle `Object.create(null)` for options objectsScott González2017-04-241-1/+6
| | | | | Fixes #15179 Closes gh-1809
* Resizable: Keep user-provided handles on destroyKonstantin Dinev2017-04-171-1/+9
| | | | | Closes gh-1798 Ref gh-1795
* Resizable: Keep user defined handles on _setOptionKonstantin Dinev2017-02-241-8/+20
| | | | | Fixes #15084 Closes gh-1795
* Spinner: Ignore `mousewheel` events when not focusedScott González2017-02-211-9/+25
| | | | | Fixes #15139 Closes gh-1794
* Selectmenu: Don't render options with the `hidden` attributeScott González2016-11-161-0/+26
| | | | Fixes #15098
* Build: Add jQuery 3.1.1Michał Gołębiowski2016-11-021-1/+1
| | | | Closes gh-1766
* Form: Rename from `.form()` to `._form()` since its not for public useScott González2016-10-111-1/+1
| | | | | Fixes #15074 Closes gh-1760
* Sortable: Setting table row placeholder height to be same as sorted rowKevin Cupp2016-10-042-7/+66
| | | | | Fixes #13662 Closes gh-1578
* Tabs: Remove presentation rolemilk542016-09-291-2/+1
| | | | | Fixes #10122 Closes gh-1748
* Resizable: Fix aspectRatio cannot be changed after initialization.Sergei Ratnikov2016-09-281-0/+22
| | | | | Fixes #4186 Closes gh-1750
* Widget: Untrack classes elements when they are removed from the DOMAlexander Schmitz2016-09-131-5/+37
| | | | | Fixes #15043 Closes gh-1744
* Draggable: Fix spurious blur in dialogs on mousedownRyan Oriecuia2016-09-131-0/+30
| | | | | | | | | | | | | | | | | | I was running into a problem with a popup menu control in a dialog; clicks weren't working (but keyboard was working fine). It turned out that the menu was getting destroyed before the click event could fire. Tracked down the issue to the way draggable blurs focused controls; it was doing the blur before it ran through the logic to figure out if the drag was actually on the handle. I've moved the blur below these checks, so it'll only blur things if it actually needs to handle the drag. Otherwise, it asserts no opinion on what should and shouldn't be focused, which seems like the way things ought to be. Also, added a unit test to check for the expected behavior. Fixes #15046 Closes gh-1730
* Slider: Add demo for custom handleScott González2016-09-132-2/+14
| | | | | Fixes #15023 Closes gh-1740
* Dialog: Fix code styleScott González2016-08-311-2/+2
|
* Dialog: Allow for subpixel calculation errors in testsScott González2016-08-311-7/+8
| | | | | | Tests were failing in IE 10-11 with values that were off by 0.01 pixels. Closes gh-1737
* Effects: Adjust animation duration in testsScott González2016-08-301-2/+2
| | | | | | | | | | | | | With jQuery 3 using `requestAnimationFrame()`, the `setTimeout()` timing for short animations wasn't working consistently. This resulted in infrequent failures everywhere (but infrequent enough that it's hard to even notice), but consistent failures in IE and Edge. Bumping up the duration and running the assertions in the middle seems to give consistent results. Eventually, we should refactor this to use `requestAnimationFrame()` in the tests themselves to avoid problems like this. Closes gh-1738
* Menu: Support number pad keyboard inputFelix Nagel2016-08-241-15/+31
| | | | | Fixes #15031 Closes gh-1732
* Widget: `instance()` should return `undefined` for empty setsScott González2016-08-041-3/+5
| | | | Fixes #15019
* Dialog: Support deprecated button optionsScott González2016-07-251-0/+30
| | | | | Fixes #15016 Closes gh-1723
* Build: Add jQuery 3.1.0Scott González2016-07-081-0/+1
|
* Tests: Only test latest patch versions for jQuery Core in TestSwarmScott González2016-07-081-0/+3
| | | | Adds some missing tests to TestSwarm and `all.html`.
* Resizable: Avoid `Array#map()` in tests for IE8Scott González2016-07-071-1/+1
|
* Tooltip: Allow tracking tooltips to be off by a fraciton of a pixelScott González2016-07-071-2/+10
| | | | Closes gh-1718
* Tests: Add jQuery 3.0.0 to missing systemsScott González2016-07-071-1/+2
|
* Effects: Fix timing of `.animateClass()` assertionScott González2016-07-061-3/+7
|
* Tabs: Remove test for Ajax URLs containing hashesScott González2016-07-061-12/+0
| | | | | | | | | This hasn't been a problem for a long time and jQuery no longer removes the hash in 3.0.0, so the test started to fail even though the actual code is working just fine. Ref #3627 Ref jquery/jquery#1732
* Controlgroup: Correctly handle non-empty child class keyGabriel Schulhof2016-07-062-0/+53
| | | | | Fixes #14984 Closes gh-1713
* Controlgroup: Add "only" position to class generator functionsAlexander Schmitz2016-06-092-0/+70
| | | | | Fixes #14972 Closes gh-1711
* All: Replace non-breaking spaces with regular spacesScott González2016-06-081-1/+1
|
* Checkboxradio: Use new `ui-state-checked` class in checkboxradioAlexander Schmitz2016-06-061-4/+4
| | | | | | | | Using `ui-state-highlight` caused a conflict with dialog Fixes #14955 Closes gh-1712 Closes gh-1704
* Controlgroup: Fix rendering of labelsAlexander Schmitz2016-05-263-6/+15
| | | | | Fixes #14967 Closes gh-1703