Commit Graph

352 Commits

Author SHA1 Message Date
Michał Gołębiowski-Owczarek
5e028c76f4 Tests: Remove remaining obsolete jQuery.cache references
PR gh-4586 removed some of those but not all.

Closes gh-4715
Ref gh-4586

(cherry picked from commit d96111e18b)
2020-05-18 18:53:26 +02:00
Michał Gołębiowski-Owczarek
8ad78cdbc4 Tests: Remove obsolete jQuery data tests
The tests relied on `jQuery.cache` so they only ever worked in jQuery 1.x.

Closes gh-4586

(cherry picked from commit eb35be528f)
2020-05-18 18:51:34 +02:00
Sean Robinson
da3dd85b63 Ajax: Do not execute scripts for unsuccessful HTTP responses
The script transport used to evaluate fetched script sources which is
undesirable for unsuccessful HTTP responses. This is different to other data
types where such a convention was fine (e.g. in case of JSON).

(cherry picked from 50871a5a85)

Fixes gh-4250
Fixes gh-4655
Closes gh-4379
2020-04-06 22:33:56 +02:00
Michał Gołębiowski-Owczarek
1d61fd9407 Manipulation: Make jQuery.htmlPrefilter an identity function
Closes gh-4642

(cherry picked from 90fed4b453)
2020-03-16 21:59:49 +01:00
Michał Gołębiowski-Owczarek
3dedc3f2d4 Core: Fire iframe script in its context, add doc param in globalEval
1. Support passing custom document to jQuery.globalEval; the script will be
   invoked in the context of this document.
2. Fire external scripts appended to iframe contents in that iframe context;
   this was already supported & tested for inline scripts but not for external
   ones.

Fixes gh-4518
Closes gh-4601

(cherry picked from commit 4592595b47)
2020-02-10 19:20:50 +01:00
Michał Gołębiowski-Owczarek
d525ae3416
Build:Tests: Fix custom build tests, verify on Travis; name Travis jobs
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
2020-01-27 18:54:47 +01:00
Michał Gołębiowski-Owczarek
46c284b12b
Build: Make Karma work in AMD mode
Also, run such a suite in CI to make sure modules are working as expected
when used directly.

(partially cherry picked from 341c6d1b5a)
(partially cherry picked from 437f389a24)

Closes gh-4595
Ref gh-4550
Ref gh-4574
2020-01-21 13:26:47 +01:00
buddh4
005040379d Core: Preserve CSP nonce on scripts with src attribute in DOM manipulation
Fixes gh-4323
Closes gh-4328
2019-03-25 18:14:24 +01:00
Michał Gołębiowski-Owczarek
0ec25abba2
Build: Run the basic test suite in jsdom
The basic test suite is now run in jsdom on all supported Node.js versions
(8, 10 & 11 as of now).

Closes gh-4310
2019-03-11 20:03:54 +01:00
Michał Gołębiowski-Owczarek
84b6a0beb1
Build: Remove manual QUnit fixture resetting
It was needed when QUnit 1.x one used but we've since upgraded to QUnit 2.x.

Closes gh-4312
Ref gh-4307
2019-03-11 17:25:48 +01:00
Michał Gołębiowski-Owczarek
6ced2639b5
Build: Update QUnit from 1.23.1 to 2.9.2
Closes gh-4307
2019-03-04 20:10:21 +01:00
Michał Gołębiowski-Owczarek
9cb124ed00
Build: Update jsdom; migrate a test with Symbol polyfill to an iframe test
So far, we've been testing that jQuery element iteration works with polyfilled
Symbol & transpiled for-of via a Node test with jsdom with the Symbol global
removed. Unfortunately, jsdom now requires Symbol to be present for its internal
functionality so such a test is no longer possible. Instead, it's been migrated
to an iframe test with transpiled JavaScript.

This PR also enables us to use ECMAScript 2017 or newer in Node.js code.

Closes gh-4305
2019-03-04 18:30:51 +01:00
abnud1
c349818742 Build: Update test code for compatibility with QUnit 2.x (#4297)
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
2019-02-18 19:03:26 +01:00
Michał Gołębiowski-Owczarek
5bdc85b82b
Core: Support passing nonce through jQuery.globalEval
Fixes gh-4278
Closes gh-4280
Ref gh-3541
Ref gh-4269
2019-01-21 18:42:39 +01:00
Michał Gołębiowski-Owczarek
e4de8b4626
Manipulation: Respect script nomodule attribute in DOM manipulation
PR #3869 added support for `<script type="module">` & some support for
the `nomodule` attribute but with no tests for `nomodule` and with the
attribute only respected on inline scripts. This commit adds support for
source-based scripts as well. It also adds tests for `nomodule`, including
making sure legacy browsers execute such scripts as they'd natively do - that's
the whole point of `nomodule` scripts, after all.

Fixes gh-4281
Closes gh-4282
Ref gh-3871
Ref gh-3869
2019-01-21 18:34:40 +01:00
Michał Gołębiowski-Owczarek
c7c2855ed1
Core: Preserve CSP nonce on scripts in DOM manipulation
Fixes gh-3541
Closes gh-4269
2019-01-14 19:29:54 +01:00
Timmy Willison
315199c156
Dimensions: fall back to offsetWidth/Height for border-box in IE
- Use getClientRects() to explicitly detect hidden/disconnected
  elements

Close gh-4223
Fixes gh-4102
2018-11-27 14:28:59 -05:00
Timmy Willison
b8195fb94c
Tests: fix ajax test failure; add to header instead of replace 2018-11-26 12:46:58 -05:00
Andrei Fangli
e0d9411569 Ajax: Fix getResponseHeader(key) for IE11
- getResponseHeader(key) combines all header values for the provided key into a
single result where values are concatenated by ', '. This does not happen for
IE11 since multiple values for the same header are returned on separate lines.
This makes the function only return the last value of the header for IE11.
- Updated ajax headers test to better cover Object.prototype collisions

Close gh-4173
Fixes gh-3403
2018-11-26 12:00:41 -05:00
Richard Gibson
dfa92ccead
Tests: Allow Karma to load unminfied source
Closes gh-4128
2018-09-07 10:14:01 -04:00
Luis Emilio Velasco Sanchez
0ba8e38d0c Traversing: $.fn.contents() support for object
Fixes gh-4045
Closes gh-4046
2018-05-14 13:41:42 -04:00
Richard Gibson
821bf34353
CSS: Correctly detect scrollbox support with non-default zoom
Fixes gh-4029
Closes gh-4030
2018-05-07 09:28:18 -04:00
Timmy Willison
625e19cd9b
Tests: ensure that module assertions run on supported browsers
- Also fixes tests for karma, where the URL for the module is different

Ref gh-3871
2018-01-16 15:18:32 -05:00
basil.belokon
5d3a968e03
Manipulation: Add support for scripts with module type
Fixes gh-3871
Close gh-3869
2018-01-16 11:39:16 -05:00
Jason Bedard
3d732cca6b Core: deprecate jQuery.isFunction
Fixes gh-3609
2018-01-15 09:26:19 -08:00
Timo Tijhof
ecd8ddea33
Tests: Add support for running unit tests via grunt with karma
- 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
2017-12-18 12:27:38 -05:00
Saptak Sengupta
f00a07590e CSS: Correctly set support properties with non-default zoom
Fixes gh-3808
Closes gh-3872
2017-12-05 23:59:54 -05:00
Richard Gibson
928c580a1a Tests: Reduce the abort timeout for simple focus testing
Ref gh-3732
2017-07-19 11:45:03 -04:00
Richard Gibson
b3defccdc0 Tests: Revert some testIframe changes to fix dimensions tests
Ref c0edd8dc18
2017-04-29 09:46:19 -04:00
Richard Gibson
72af0c4c7e Revert "Tests: Revert some testIframe changes to fix dimensions tests"
This reverts commit c4368a9311.
2017-04-29 02:05:46 -04:00
Richard Gibson
c4368a9311 Tests: Revert some testIframe changes to fix dimensions tests
Ref c0edd8dc18
2017-04-29 02:00:12 -04:00
Richard Gibson
e94b5b0bbf Tests: Clean up offset debugging
Ref 1d2df772b4
Ref c0edd8dc18
2017-04-29 01:35:20 -04:00
Richard Gibson
da533c6acc Tests: Adjust by actual scroll position, rather than expected
Ref 1d2df772b4
2017-04-29 01:22:55 -04:00
Richard Gibson
c0edd8dc18 Tests: Keep iframes visible in TestSwarm
Ref 1d2df772b4
2017-04-28 23:54:06 -04:00
Richard Gibson
5aaa514555 Tests: Prepend test iframes for even *more* consistency
Ref 1d2df772b4
2017-04-25 16:32:40 -04:00
Richard Gibson
bb757213b2 Tests: Allow a mock QUnit.test for perfect testIframe fidelity
Ref 1d2df772b4
Closes gh-3647
2017-04-25 16:22:35 -04:00
Richard Gibson
bb79f728b0 Tests: Attach test iframes to the body for visibility-dependent code
Ref 1d2df772b4
Closes gh-3645
2017-04-25 15:39:41 -04:00
Richard Gibson
87a2d3aae7 Tests: Be even more async for iOS
Ref 1d2df772b4
Closes gh-3643
2017-04-24 22:59:18 -04:00
Richard Gibson
9e121482a5 Tests: Improve offset test setup and labels
Hopefully this fixes iOS testing: http://swarm.jquery.org/job/5226

Ref 1d2df772b4
Closes gh-3641
2017-04-24 21:44:51 -04:00
Richard Gibson
1d2df772b4 Offset: Use correct offset parents; include all border/scroll values
Thanks @anseki

Fixes gh-3080
Fixes gh-3107
Closes gh-3096
Closes gh-3487
2017-04-24 12:15:39 -04:00
Steve Mao
fcc9a9ec96
Tests: move readywait to an iframe test
Close gh-3576
Fixes gh-3573
2017-03-20 11:37:15 -04:00
Manoj Kumar
1b9575b9d1 Core: Deprecate jQuery.isArray
Fixes gh-2961
Closes gh-3278
2016-11-30 12:22:24 +01:00
Timmy Willison
3bbcce68d7
Core: rnotwhite -> rhtmlnotwhite and jQuery.trim -> stripAndCollapse
- Renames and changes rnotwhite to focus on HTML whitespace chars
- Change internal use of jQuery.trim to more accurate strip and collapse
- Adds tests to ensure HTML space characters are retained where valid
- Doesn't add tests where the difference is inconsequential and
  existing tests are adequate.

Fixes gh-3003
Fixes gh-3072
Close gh-3316
2016-09-15 10:40:27 -04:00
Timmy Willison
52e24471c8
Core: expose noConflict in AMD mode
- For compability reasons, we had already added the global
  in AMD mode, but without noConflict. This adds back noConflict
  to AMD (which fixes noConflict mode in the tests).

Fixes gh-2930
2016-08-15 11:54:55 -04:00
Oleg Gaidarenko
58c6ca9822 Build: ESLint details
Use eslint pragmas, fix new errors, etc

Closes gh-3148
2016-06-11 10:41:33 +03:00
Christophe Tafani-Dereeper
69db408d82 CSS: Remove units from a 0 width/height element
Close gh-3122
2016-05-16 10:46:47 -04:00
Dave Methvin
e5ffcb0838 Tests: Refactor testIframe() to make it DRYer and more consistent
Ref gh-3040
Closes gh-3049
2016-04-11 13:32:51 -04:00
Dave Methvin
08d73d7f9c Tests: Make iframe tests wait after checking isReady
Ref gh-3040
2016-04-11 13:29:11 -04:00
Oleg Gaidarenko
c158f5761a Tests: do not run IE9 effect tests if inside testswarm
That test doesn't work properly in such environment

Ref e04e246552
Fixes gh-2888
Closes gh-3034
2016-04-04 21:58:33 +03:00
Michał Gołębiowski
622db29d9c Docs:Tests: Remove legacy code & add support comments where needed
This commits backports some changes done in the patch to the then-existing
compat branch that removed support for old browsers and added some support
comments.

Refs 90d7cc1d8b
2016-03-30 11:21:36 +02:00