Commit Graph

230 Commits

Author SHA1 Message Date
Michał Gołębiowski-Owczarek
dff0dc0d6a
Tests: Fix the "dialog: core: focus tabbable" test in IE
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
2021-03-16 22:17:25 +01:00
Michał Gołębiowski-Owczarek
e7a10c70ae
Tests: Ensure no timers are running at the end of each test (#1920)
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
2020-05-16 09:16:24 +02:00
Michał Gołębiowski-Owczarek
0c860b0d92
All: Remove usage of jQuery positional selectors
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
2020-01-22 16:44:34 +01:00
Michał Gołębiowski-Owczarek
98b539171b All: Migrate away from deprecated/removed Core APIs
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
2019-12-08 22:23:08 +01:00
Scott González
4e39014803 Dialog: Fix code style 2016-08-31 11:22:54 -04:00
Scott González
d2ce363200 Dialog: Allow for subpixel calculation errors in tests
Tests were failing in IE 10-11 with values that were off by 0.01 pixels.

Closes gh-1737
2016-08-31 11:01:39 -04:00
Scott González
6c754b4b5b Dialog: Support deprecated button options
Fixes #15016
Closes gh-1723
2016-07-25 08:38:51 -04:00
Amanpreet Singh
86fd11d5a7 Dialog: Shift to use no globals 2016-04-14 00:06:12 +05:30
Jörn Zaefferer
9644e7bae9 Dialog: Escape closeText option before passing it to button
Ref gh-1632
Fixes jquery/api.jqueryui.com#281
2015-10-28 19:48:35 +01:00
Jörn Zaefferer
3570cc5a2b Tests: Fix button space assertions on IE8
IE8 still doesn't keep the space in the text (or HTML) representation.
We don't really care, so adding more trims in these tests as well.
2015-10-25 11:25:00 -04:00
Alexander Schmitz
1beeb94196 Dialog: address review comments 2015-10-08 14:02:57 -04:00
Alexander Schmitz
897ec38e63 Dialog: Updating dialog and tests for new button API 2015-10-07 10:57:59 -04:00
Alexander Schmitz
f8c2bbb0c8 Dialog: Style updates
Ref #14246
2015-09-11 08:29:09 -04:00
Alexander Schmitz
9ef84a6bf0 Dialog: Style updates
Ref #14246
Ref gh-1588
2015-08-21 08:06:23 -04:00
Alexander Schmitz
59ea81003d Effects: Move individual effects into effects folder
Ref #13885
2015-08-08 00:29:38 -04:00
Alexander Schmitz
5efa98361e Dialog: Move dialog into widgets folder
Ref #13885
2015-08-08 00:29:37 -04:00
Alexander Schmitz
be0a176b1f Dialog: Remove core event/alias and deprecated module dependencies 2015-05-20 14:27:55 -04:00
Scott González
6231b161b9 Tests: Fix AMD loading in IE8
It appears that we must load require.js via a standard script tag in order
for it to work properly in IE8.
2015-04-17 12:13:38 -04:00
Scott González
bde431bb44 Tests: Rename files
Ref gh-1528
2015-04-09 09:27:00 -04:00
Scott González
dc4b015a8b Tests: Widget test helpers extend the main helper
Ref #10119
Ref gh-1528
2015-04-09 09:26:58 -04:00
Scott González
7d4811206f Dialog: Convert tests to new infrastructure
Ref #10119
Ref gh-1528
2015-04-09 09:26:27 -04:00
Scott González
2e1c72fb59 Tests: Convert closeEnough() to a proper QUnit assertion
Should eventually replace with qunit-assert-close.

Ref #10119
Ref gh-1528
2015-04-09 09:24:45 -04:00
Scott González
500f6b4992 Tests: Switch to the new qunit-composite module
This module was created from our existing implementation.

Closes gh-1532
2015-04-07 09:03:36 -04:00
Scott González
899d90709a Tests: Handle jQuery git returning null for empty attributes
jQuery now returns `null` for empty attributes instead of `undefined`.

Closes gh-1516
2015-03-25 15:55:53 -04:00
Alexander Schmitz
2d5857ca9e Draggable: Use new has/lacksClasses assertions for all class checks 2015-03-11 16:05:39 -04:00
Alexander Schmitz
a9fa490418 Dialog: Use new has/lacksClasses assertions for all class checks 2015-03-11 16:05:39 -04:00
Alexander Schmitz
6f4884f6f5 Dialog: Add classes option
Ref #7053
Ref gh-1411
2015-03-11 16:04:11 -04:00
Alexander Schmitz
c192d4086d Widget: Add classes option and _add/_remove/_toggleClass methods
Fixes #7053
Closes gh-1411
2015-03-11 16:00:04 -04:00
Scott González
1f9821c000 Dialog: Remove animation stopping in destroy
Effects wrappers are no longer used, so the workaround and test are no
longer necessary.

This fixes tests in IE8 with jQuery 1.7.

Effectively a complete revert of 13505e5945

Closes gh-1481
2015-03-11 08:42:12 -04:00
Scott González
a6a18d1ed8 Dialog: Fix focus tests in IE8 with jQuery 1.7
Ref gh-1481
2015-03-11 08:42:04 -04:00
Jörn Zaefferer
666f051c3a Tests: Reduce timeouts to optimize testsuite runtime 2015-03-04 23:04:07 +01:00
Jörn Zaefferer
2aabd427eb Tests: Fix style issues with missing or multiple line breaks
As pointed out by jscs, after a esformatter run. The latter doesn't
address these, so fixing them manually.
2015-01-24 17:10:20 +01:00
Scott González
6d7589351e All: Drop support for IE7
Fixes #9838
Closes gh-1365
2014-10-21 09:06:58 -04:00
Scott González
b2a477f1bf Dialog: Remove leftover backcompat flag in tests 2014-10-20 19:07:43 -04:00
Mike Sherov
aa425ab95d Build: Pull in jquery.simulate.js from Bower
Fixes #10563
2014-08-22 17:01:50 -04:00
Scott González
c017628e11 Tests: Fix composite tests 2014-08-01 12:25:14 -04:00
Scott González
6df127a0b5 Build: Reorganize external directory
Put each external library into its own directory.
Move jquery.js to external.

Ref gh-1266
2014-06-24 22:45:32 -04:00
Jörn Zaefferer
226cc3e9e5 Dialog: Honor preventDefault when managing focus
If event.isDefaultPrevented() is true, the focus management is
completely skipped, assuming the user manages focus manually.

Fixes #10103
Closes gh-1265
2014-06-10 13:59:45 +02:00
Jörn Zaefferer
a0b84767a7 Dialog: Fix shift-tab handling, focus the correct element
Copy-paste error introduced in df6110c0d4

Updates the tabbing test to be more specific about which element should
have focus, instead of only checking if focus is within the dialog.

Ref #9646
Ref #10103
Closes gh-1264
2014-06-10 13:54:58 +02:00
Jörn Zaefferer
a40647f0e5 All: Rename jquery.js to exclude version in filename 2014-03-05 10:19:11 +01:00
Jörn Zaefferer
122b913743 Dialog: Work around subpixel issues in dialog resizable test
Switching to checking the size of the content element. We should be
checking the dimensions of the .ui-dialog element, but that currently
fails in Chromium-based browsers. Once we start using box-sizing:
border-box, we should try to revert this change.

Ref #9845
2014-02-20 17:54:48 +01:00
Jörn Zaefferer
822f3cd9d0 Tests: Update to sane QUnit markup 2014-02-20 17:05:02 +01:00
Brian J. Dowling
9660b43c01 Tests: Fix andenable a couple of unit tests: dialog, tooltip, draggable
Some unit tests were disabled in phantomjs. Dialog and draggable
depended on a larger viewPort. Tooltip just worked, that was reenabled
as well.

Closes gh-1173
2014-02-11 19:47:29 +01:00
Rafael Xavier de Souza
21154cfa2e All: Rename all files, removing the "jquery.ui." prefix;
- By executing https://gist.github.com/jzaefferer/893fcf70b7eebc1dc271;

Fixes #9464
Closes gh-1029
2014-01-24 18:22:49 -02:00
Jörn Zaefferer
1096f19f37 Dialog: Keep track of instances to focus when elements outside the dialog get focus. Works with inheritance. Adds tests for both. Fixes #9241 - Dialog: UI dialog inheritance causes undefined property '_focusTabbable' in IE9 2013-11-20 16:04:13 +01:00
Jörn Zaefferer
0e5a2e126a Dialog: Restore focus to the previously focused element when window regains focus. Fixes #9101 - Dialog: Track last focused element instead of always focusing the first tabbable element 2013-11-15 08:16:24 +01:00
Scott González
ce5539f368 Dialog tests: Work around focus issue in IE8. 2013-11-14 10:32:09 -05:00
Scott González
144268a2eb Dialog test: Ensure dialog is tall enough to be scrolled. 2013-11-14 10:10:42 -05:00
Jörn Zaefferer
e263ebda99 Dialog: Switch back to shuffling z-index, but only look at .ui-front siblings.
Fixes #9166 - Dialog: moveToTop implementation resets flash/video/iframe/scroll
Fixes #9364 - Dialog: Click of element with tooltip scrolls the dialog to the top
2013-10-02 17:02:28 +02:00
Scott González
e628d0e4ba Dialog: Capitalize default value for closeText option. Fixes #9500 - Dialog: Capitalize 'close' for closeText option. 2013-08-15 16:56:49 -04:00