aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/support.js
Commit message (Collapse)AuthorAgeFilesLines
* CSS: Fix dimensions of table `<col>` elementsMichał Gołębiowski-Owczarek2025-02-241-0/+16
| | | | | | | | | | | | | | | | Changes: 1. Fix measurements of `<col span="2">` elements in Firefox. 2. Fix measurements of all implicitly sized `<col>` elements in Safari. Firefox always reports computed width as if `span` was 1. In Safari, computed width for columns is always 0. Work around both issues by using `offsetWidth`. In IE/Edge, `<col>` computed width is `"auto"` unless `width` is set explicitly via CSS so measurements there remain incorrect. Because of the lack of a proper workaround, we accept this limitation. Fixes gh-5628 Closes gh-5634 Ref gh-5630
* CSS:Tests: Fix tests & support tests under CSS Zoom (3.x version)Michał Gołębiowski-Owczarek2024-06-031-0/+20
| | | | | | | | | | | | | | | | Firefox 126+ implements CSS zoom in a way it affects width computed style very slightly (`100.008px` instead of `100px`); accept that difference. Also, skip the width setter under zoom test in Firefox 126 completely - that version has CSS zoom affecting `offsetWidth` values. This has been fixed in Firefox 127 so it's not worth working around it. Add a test for support tests resolving the same under CSS zoom & without one. That test uncovered Chrome failing the `reliableTrDimensions` support test under zoom; the test has been fixed. Fixes gh-5489 Closes gh-5496 Ref gh-5495
* Tests: migrate testing infrastructure to minimal dependenciesTimmy Willison2024-03-051-36/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a complete rework of our testing infrastructure. The main goal is to modernize and drop deprecated or undermaintained dependencies (specifically, grunt, karma, and testswarm). We've achieved that by limiting our dependency list to ones that are unlikely to drop support any time soon. The new dependency list includes: - `qunit` (our trusty unit testing library) - `selenium-webdriver` (for spinning up local browsers) - `express` (for starting a test server and adding middleware) - express middleware includes uses of `body-parser` and `raw-body` - `yargs` (for constructing a CLI with pretty help text) - BrowserStack (for running each of our QUnit modules separately in all of our supported browsers) - `browserstack-local` (for opening a local tunnel. This is the same package still currently used in the new Browserstack SDK) - We are not using any other BrowserStack library. The newest BrowserStack SDK does not fit our needs (and isn't open source). Existing libraries, such as `node-browserstack` or `browserstack-runner`, either do not quite fit our needs, are under-maintained and out-of-date, or are not robust enough to meet all of our requirements. We instead call the [BrowserStack REST API](https://github.com/browserstack/api) directly. **BrowserStack** - automatically retries individual modules in case of test failure(s) - automatically attempts to re-establish broken tunnels - automatically refreshes the page in case a test run has stalled - Browser workers are reused when running isolated modules in the same browser - runs all browsers concurrently and uses as many sessions as are available under the BrowserStack plan. It will wait for available sessions if there are none. - supports filtering the available list of browsers by browser name, browser version, device, OS, and OS version (see `npm run test:unit -- --list-browsers` for more info). It will retrieve the latest matching browser available if any of those parameters are not specified. Supports latest and latest-\d+ in place of browser version. - cleans up after itself (closes the local tunnel, stops the test server, etc.) - Requires `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables. **Selenium** - supports running any local browser as long as the driver is installed, including support for headless mode in Chrome, FF, and Edge - supports running `basic` tests on the latest [jsdom](https://github.com/jsdom/jsdom#readme), which can be seen in action in this PR (see `test:browserless`) - Node tests will run as before in PRs and all non-dependabot branches, but now includes tests on real Safari in a GH actions macos image instead of playwright-webkit. - can run multiple browsers and multiple modules concurrently Other notes: - Stale dependencies have been removed and all remaining dependencies have been upgraded with a few exceptions: - `sinon`: stopped supporting IE in version 10. But, `sinon` has been updated to 9.x. - `husky`: latest does not support Node 10 and runs on `npm install`. Needed for now until git builds are migrated to GitHub Actions. - `rollup`: latest does not support Node 10. Needed for now until git builds are migrated to GitHub Actions. - BrowserStack tests are set to run on each `main` branch commit - `debug` mode leaves Selenium browsers open whether they pass or fail and leaves browsers with test failures open on BrowserStack. The latter is to avoid leaving open too many sessions. - This PR includes a workflow to dispatch BrowserStack runs on-demand - The Node version used for most workflow tests has been upgraded to 20.x - updated supportjQuery to 3.7.1 Run `npm run test:unit -- --help` for CLI documentation Close gh-5427
* CSS: Make the reliableTrDimensions support test work with Bootstrap CSS (3.x ↵Michał Gołębiowski-Owczarek2023-07-101-0/+12
| | | | | | | | | | | | | | | | | | | | | version) Bootstrap 5 includes the following CSS on the page: ```css *, *::before, *::after { box-sizing: border-box; } ``` That threw our `reliableTrDimensions` support test off. This change fixes the support test and adds a unit test ensuring support test values on a page including Bootstrap 5 CSS are the same as on a page without it. Fixes gh-5270 Closes gh-5279 Ref gh-5278
* Tests: Indicate Chrome 112 & Safari 16.4 pass the cssHas support test (3.x ↵Michał Gołębiowski-Owczarek2023-04-051-26/+76
| | | | | | | | | | | | version) Chrome 112 & Safari 16.4 introduce two changes: * `:has()` is non-forgiving * `CSS.supports( "selector(...)" )` parses everything in a non-forgiving way We no longer care about the latter but the former means the `cssHas` support test now passes. Closes gh-5226
* Event: Simulate focus/blur in IE via focusin/focusout (3.x version)Michał Gołębiowski-Owczarek2023-03-271-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In IE (all versions), `focus` & `blur` handlers are fired asynchronously but `focusin` & `focusout` are run synchronously. In other browsers, all those handlers are fired synchronously. Asynchronous behavior of these handlers in IE caused issues for IE (gh-4856, gh-4859). We now simulate `focus` via `focusin` & `blur` via `focusout` in IE to avoid these issues. This also let us simplify some tests. This commit also simplifies `leverageNative` - with IE now using `focusin` to simulate `focus` and `focusout` to simulate `blur`, we don't have to deal with async events in `leverageNative`. This also fixes broken `focus` triggers after first triggering it on a hidden element - previously, `leverageNative` assumed that the native `focus` handler not firing after calling the native `focus` method meant it would be handled later, asynchronously, which was not the case (gh-4950). To preserve relative `focusin`/`focus` & `focusout`/`blur` event order guaranteed on the 3.x branch, attach a single handler for both events in IE. A side effect of this is that to reduce size the `event/focusin` module no longer exists and it's impossible to disable the `focusin` patch in modern browsers via the jQuery custom build system. Fixes gh-4856 Fixes gh-4859 Fixes gh-4950 Ref gh-5223 Closes gh-5224 Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Selector: Stop relying on CSS.supports( "selector(...)" )Michał Gołębiowski-Owczarek2023-02-141-55/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | `CSS.supports( "selector(...)" )` has different semantics than selectors passed to `querySelectorAll`. Apart from the fact that the former returns `false` for unrecognized selectors and the latter throws, `qSA` is more forgiving and accepts some invalid selectors, auto-correcting them where needed - for example, mismatched brackers are auto-closed. This behavior difference is breaking for many users. To add to that, a recent CSSWG resolution made `:is()` & `:where()` the only pseudos with forgiving parsing; browsers are in the process of making `:has()` parsing unforgiving. Taking all that into account, we go back to our previous try-catch approach without relying on `CSS.supports( "selector(...)" )`. The only difference is we detect forgiving parsing in `:has()` and mark the selector as buggy. The PR also updates `playwright-webkit` so that we test against a version of WebKit that already has non-forgiving `:has()`. Fixes gh-5194 Closes gh-5207 Ref gh-5206 Ref gh-5098 Ref gh-5107 Ref w3c/csswg-drafts#7676
* Build: Run GitHub Action browser tests on Playwright WebKitMichał Gołębiowski-Owczarek2023-01-241-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | So far, we've been running browser tests on GitHub Actions in Chrome and Firefox. Regular Safari is not available in GitHub Actions but Playwright WebKit comes close to a dev version of Safari. With this change, our GitHub CI & local test runs will invoke tests on all actively developed browser engines on all PRs. Also, our GitHub Actions browser tests are now running on Node.js 18. Detection of the Playwright WebKit browser in support unit tests is done by checking if the `test_browser` query parameter is set to `"Playwright"`; this is a `karma-webkit-launcher` feature. Detecting that browser via user agent as we normally do is hard as the UA on Linux is very similar to a real Safari one but it actually uses a newer version of the engine. In addition, we now allow to pass custom browsers when one needs it; e.g., to run the tests in all three engines on Linux/macOS, run: ``` grunt && BROWSERS=ChromeHeadless,FirefoxHeadless,WebkitHeadless grunt karma:main ``` Closes gh-5190 (cherry picked from commit b02a257f98688aa890e06a85672cd1a54c3ffa3a)
* Selector: Inline Sizzle into the selector module: 3.x version (#5113)Michał Gołębiowski-Owczarek2022-12-141-224/+359
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes Sizzle from jQuery, inlining its code & removing obsolete workarounds where applicable. The Sizzle AUTHORS.txt file has been merged with the jQuery one - people are sorted by their first contributions to either of the two repositories. The main `selector` module can be disabled in favor of `selector-native` via: grunt custom:-selector For backwards compatibility, the legacy `sizzle` alias is also supported (it will be dropped in jQuery `4.0.0`): grunt custom:-selector Sizzle tests have been ported to jQuery ones. Ones that are not compatible with the `selector-native` module are disabled if the regular selector module is excluded. Backwards compatibility is still kept for all `Sizzle` utils - they continue to be available under `jQuery.find` - but the primary implementation is now attached directly to jQuery. Some selector utils shared by `selector` & `selector-native` have been extracted & deduplicated. `jQuery.text` and `jQuery.isXMLDoc` have been moved to the `core` module. The commit reduces the gzipped jQuery size by 851 bytes compared to the `3.x-stable` branch. Closes gh-5113 Ref gh-4395 Ref gh-4406
* Tests: Exclude tests based on compilation flags, not API presence (3.x version)Michał Gołębiowski-Owczarek2022-07-121-2/+2
| | | | | | | | | | | | | Introduces a new test API, `includesModule`. The method returns whether a particular module like "ajax" or "deprecated" is included in the current jQuery build; it handles the slim build as well. The util was created so that we don't treat presence of particular APIs to decide whether to run a test as then if we accidentally remove an API, the tests would still not fail. Closes gh-5071 Fixes gh-5069 Ref gh-5046 (partially cherry picked from commit fae5fee8b435cc20352d28b0a384b9784b1ad9ed)
* Docs: Replace `#NUMBER` Trac issue references with `trac-NUMBER`Michał Gołębiowski-Owczarek2022-01-121-1/+1
| | | | | | | | | | | | | | | | | This is a version of gh-4993 for the `3.x-stable` branch. The GitHub UI treats `#NUMBER` as referring to its own issues which is confusing when in jQuery source it's usually referring to the old deprecated Trac instance at https://bugs.jquery.com. This change replaces all such Trac references with `trac-NUMBER`. A few of the references came with the Sizzle integration and referred to the Sizzle GitHub bug tracker. Those have been replaced with full links instead. A new entry describing issue reference conventions has been added to README. Closes gh-4994 Ref gh-4993 Ref 5d5ea015114092c157311c4948f7cc3d8c8e7f8a
* Dimensions: Modify reliableTrDimensions support test to account for FFTimmy Willison2021-01-111-1/+1
| | | | | | | | | Firefox incorrectly (or perhaps correctly) includes table borders in computed dimensions, but they are the only one. Workaround this by testing for it and falling back to offset properties Fixes gh-4529 Closes gh-4807
* Manipulation: Skip the select wrapper for <option> outside of IE 9Michał Gołębiowski-Owczarek2020-03-301-0/+13
| | | Closes gh-4647
* Build:Tests: Fix custom build tests, verify on Travis; name Travis jobsMichał Gołębiowski-Owczarek2020-01-271-1/+9
| | | | | | | | | | | | | | | | This commit fixes unit tests for the following builds: 1. The no-deprecated build: `custom:-deprecated` 2. The current slim build: `custom:-ajax,-effects` 3. The 4.0 (#4553) slim build: `custom:-ajax,-callbacks,-deferred,-effects` It also adds separate Travis jobs for the no-deprecated & slim builds. Apart from that, add intuitive names to Travis jobs. Otherwise it's hard to see at a glance that a particular job is running on Firefox ESR, for example. Ref gh-4577 Ref gh-4596 Closes gh-4600
* Tests: Make the support tests pass on Firefox 4x/5x/60Michał Gołębiowski-Owczarek2020-01-071-1/+1
| | | | | | | The check for old Firefox versions with different support test result only checked for Firefox 52 or 60. It now checks for 4x/5x/60 to understand more versions. Closes gh-4583
* CSS: Workaround buggy getComputedStyle on table rows in IE/EdgeMichał Gołębiowski-Owczarek2019-10-141-0/+13
| | | | Fixes gh-4490 Closes gh-4503
* Tests: Move Android user agent detection above iOS, put Safari lastMichał Gołębiowski-Owczarek2019-09-241-4/+4
| | | | | | Android was catching the generic iOS regex. Checking for Android first should eliminate that issue as iOS user agents don't contain the word "Android". Putting Safari last makes Android UAs not be tested against it.
* Tests: Make support tests accept Safari 13 & newerMichał Gołębiowski-Owczarek2019-09-231-5/+5
| | | | | | | | The regexes detecting browsers with their versions have been updated for iOS and Safari so that all iOS >=11 & all Safari (desktop) >= 11 are recognized. This is required to make Safari 13 & iOS 13 pass support tests but it'll also make tests forward-compatible with future Safari/iOS versions. Closes gh-4488
* Build: Update test code for compatibility with QUnit 2.x (#4297)abnud12019-02-181-1/+1
| | | | | | | | Also, run `grunt npmcopy` to sync the "external" directory with dependencies from package.json. For example, the Sinon library version didn't match. Ref gh-4234 Closes gh-4297
* Tests: Add Safari 12 & iOS 12 resultsMichał Gołębiowski-Owczarek2018-11-121-6/+6
|
* Tests: Move latest Firefox before Firefox 60 test resultsMichał Gołębiowski-Owczarek2018-11-121-4/+4
|
* CSS: Don't read styles.position in the width/height cssHook unless necessaryMichał Gołębiowski-Owczarek2018-10-081-1/+1
| | | | | | | | | | | | Current width/height cssHook reads the computed position style even if not necessary as the browser passes the scrollboxSize support test. That has been changed. This commit also makes the scrollboxSize support test in line with all others (i.e. only return true or false) and changes the variable name in the hook to make the code clearer. Fixes gh-4185 Closes gh-4187
* Tests: Account for the iPad with iOS 11.3 user agentMichał Gołębiowski-Owczarek2018-08-011-1/+1
| | | | | | The user agent of the iPad with iOS 11.3 on BrowserStack is missing the "iPhone" part in the "iPhone OS 11_3" part. This commit makes the iOS regex accept such (probably?) malformed UAs.
* Tests: Make support tests pass in Firefox 52Michał Gołębiowski-Owczarek2018-07-301-1/+1
| | | | jQuery Core now supports Firefox ESR.
* Tests: Add support test results for Firefox 61+Michał Gołębiowski-Owczarek2018-07-091-1/+20
| | | | | Firefox 61 now passes the reliableMarginLeft test. Closes gh-4122
* Tests: ensure support tests are failed by at least one tested browserMichał Gołębiowski-Owczarek2018-04-231-205/+253
| | | | | | | | A whitelist is available so that some tests can be allowed to always succeed. This is used only for ajax for now as it can be manually disabled in IE but is enabled by default. Closes gh-4052
* Tests: Add support for running unit tests via grunt with karmaTimo Tijhof2017-12-181-3/+3
| | | | | | | | | | | | | - Update QUnit to 1.23.1 - Remove unused dl#dl from test/index.html - Remove unused map#imgmap from test/index.html - Ensure all urls to data use baseURI - Add the 'grunt karma:main' task - customContextFile & customDebugFile - Add 'npm run jenkins' script Close gh-3744 Fixes gh-1999
* Tests: Add iOS 11 support test resultsMichał Gołębiowski-Owczarek2017-11-201-0/+18
|
* Tests: Add Safari 11 support test resultsMichał Gołębiowski-Owczarek2017-10-181-0/+18
|
* CSS: Detect more WebKit styles erroneously reported as percentagesRichard Gibson2017-09-181-10/+10
| | | | | Ref 692f9d4db30c9c6c4f6bc76005cf153586202fa6 Fixes gh-3777 Closes gh-3778
* Support: Properly check for IE9 absolute scrollbox mishandlingRichard Gibson2017-07-181-10/+20
| | | | | | Ref gh-3589 Fixes gh-3699 Fixes gh-3730 Closes gh-3729
* Docs:Tests: Update IE/Edge-related support comments & testsMichał Gołębiowski2017-05-151-3/+2
| | | Closes gh-3661
* Tests: Add test results for Safari 10/iOS 10, remove for Safari 8Michał Gołębiowski2016-09-191-19/+2
|
* Tests: Make the regex catching Safari 9.0/9.1 more resilientMichał Gołębiowski2016-05-021-1/+1
| | | | The word boundary character will prevent iOS from being a false positive.
* Tests: take Safari 9.1 into accountMichał Gołębiowski2016-05-021-1/+1
| | | | | Safari 9.1 shares its support test results with Safari 9.0 but it's been excluded from the regex catching Safari 9.0. This has been fixed.
* Tests: Refactor testIframe() to make it DRYer and more consistentDave Methvin2016-04-111-4/+4
| | | | | Ref gh-3040 Closes gh-3049
* Build: enable JSCS for test/unit/support.js, fix styling issuesMichał Gołębiowski2016-01-271-3/+5
|
* Tests: Set Edge's expected support for clearCloneStyle to trueZack Hall2016-01-271-2/+3
| | | | | | This is done for a version 13 or newer as the bug still exists in Edge 12. Closes gh-2857
* Tests: Make regexes for iOS devices more rigidMichał Gołębiowski2015-10-301-3/+3
|
* Tests: Remove Safari 7.0 & iOS 6 support tests resultsMichał Gołębiowski2015-10-301-18/+1
|
* Tests: Add iOS 9 support tests resultsMichał Gołębiowski2015-10-301-0/+17
|
* Tests: Add Safari 9 support tests resultsMichał Gołębiowski2015-10-181-0/+17
|
* CSS: Correct misrepresentation of "auto" horizontal margins as 0Richard Gibson2015-10-181-29/+40
| | | | | | | | | | | | Fixes gh-2237 Closes gh-2276 (cherry picked from commit 214e1634ab9b1d13d53647dd5de3bdf7a091d49c) Conflicts: src/css.js src/css/support.js test/unit/support.js
* Ajax:Attributes:CSS:Manipulation: Reduce Android 2.3 supportMichał Gołębiowski2015-09-141-48/+10
| | | | | | | | Drop non-critical workarounds for Android 2.3. Fixes gh-2483 Fixes gh-2505 Closes gh-2581
* Tests: further improvements QUnit 2.0 migrationOleg Gaidarenko2015-09-081-3/+3
| | | | | | | | * Remove QUnit jshint globals * Extend QUnit.assert methods * Use assert.async instead of start/stop/done Ref b930d14ce64937e9478405eee2828d4da091d2cb
* Build: Update jscs and lint filesOleg Gaidarenko2015-09-071-7/+9
| | | | Fixes gh-2056
* Tests: partially use new qunit interfaceOleg Gaidarenko2015-08-161-20/+25
| | | | | | | | | | | | http://qunitjs.com/upgrade-guide-2.x/ For most of the boring work was used https://github.com/apsdehal/qunit-migrate package However, it can't update local qunit helpers, plus in some places old QUnit.asyncTest signature is still used Fixes gh-2540
* Core: Adjust comments & tests after dropping Safari 6 supportMichał Gołębiowski2015-07-271-1/+1
| | | | | | | | Support comments that mentioned only Safari < 7 were checked & updated to account for bugs existing in newer versions as well; Safari 6 support test results were removed. Refs gh-2482
* Tests: Remove Edge version from the user agentMichał Gołębiowski2015-06-161-1/+1
| | | | | | The version will change in the future, matching by /edge\//i is enough Refs 8e111df641cca3e1b75b31a1971bfc89014b4ded
* Tests: Add Microsoft Edge results (from Windows 10 build 10130)Michał Gołębiowski2015-06-141-4/+22
| | | | | The Microsoft Edge user agent contains "Chrome" so it needs to be checked before Chrome.