aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/jquery.js4
-rw-r--r--test/unit/ajax.js6
-rw-r--r--test/unit/core.js8
-rw-r--r--test/unit/css.js12
-rw-r--r--test/unit/data.js16
-rw-r--r--test/unit/effects.js6
-rw-r--r--test/unit/manipulation.js29
-rw-r--r--test/unit/selector.js16
-rw-r--r--test/unit/support.js35
9 files changed, 35 insertions, 97 deletions
diff --git a/test/jquery.js b/test/jquery.js
index 2d12a5ff3..329285251 100644
--- a/test/jquery.js
+++ b/test/jquery.js
@@ -58,8 +58,8 @@
// This doesn't apply to iframes because they synchronously expect jQuery to be there.
if ( config.esmodules && QUnit ) {
- // Support: IE 11+, Edge 12 - 18+
- // IE/Edge don't support the dynamic import syntax so they'd crash
+ // Support: IE 11+
+ // IE doesn't support the dynamic import syntax so it would crash
// with a SyntaxError here.
dynamicImportSource = "" +
"import( `${ parentUrl }src/jquery.js` )\n" +
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index db0af6cec..b3b78cc5f 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -271,7 +271,7 @@ QUnit.module( "ajax", {
"Nullable": null,
"undefined": undefined
- // Support: IE 9 - 11+, Edge 12 - 14 only
+ // Support: IE 9 - 11+
// IE can receive empty headers but not send them.
}, QUnit.isIE ? {} : {
"Empty": ""
@@ -2281,9 +2281,7 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
// beforeunload, unload, pagehide, and visibilitychange event handlers.
// See https://bugs.chromium.org/p/chromium/issues/detail?id=952452
// Safari 13 did similar changes. The below check will catch them both.
- // Edge Legacy fakes Chrome which fakes Safari in their user agents so we need
- // to exclude Edge specifically here so that the test continues to run there.
- if ( !/safari/i.test( navigator.userAgent ) || /edge\//i.test( navigator.userAgent ) ) {
+ if ( !/safari/i.test( navigator.userAgent ) ) {
testIframe(
"#14379 - jQuery.ajax() on unload",
"ajax/onunload.html",
diff --git a/test/unit/core.js b/test/unit/core.js
index d457e91fa..e24966551 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -801,15 +801,15 @@ QUnit.test( "jQuery.map", function( assert ) {
assert.equal( result.length, 3, "Array flatten only one level down" );
assert.ok( Array.isArray( result[ 0 ] ), "Array flatten only one level down" );
- // Support: IE 11+, Edge 18+
- // Skip the test in browsers without Array#flat.
- if ( Array.prototype.flat ) {
+ // Support: IE 11+
+ // IE doesn't have Array#flat so it'd fail the test.
+ if ( !QUnit.isIE ) {
result = jQuery.map( Array( 300000 ), function( v, k ) {
return k;
} );
assert.equal( result.length, 300000, "Able to map 300000 records without any problems (#4320)" );
} else {
- assert.ok( "skip", "Array#flat doesn't supported on all browsers" );
+ assert.ok( "skip", "Array#flat isn't supported in IE" );
}
} );
diff --git a/test/unit/css.js b/test/unit/css.js
index 095f3641b..6d2983f87 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -638,9 +638,9 @@ QUnit.test( "show/hide detached nodes", function( assert ) {
span.remove();
} );
-// Support: IE 11+, Edge 12 - 18+
-// IE/Edge don't support Shadow DOM.
-QUnit[ document.body.getRootNode ? "test" : "skip" ](
+// Support: IE 11+
+// IE doesn't support Shadow DOM.
+QUnit.testUnlessIE(
"show/hide shadow child nodes", function( assert ) {
assert.expect( 28 );
@@ -1022,7 +1022,7 @@ QUnit[ QUnit.jQuerySelectors && jQuery.fn.toggle ? "test" : "skip" ]( "detached
"cascade-hidden element in detached tree" );
} );
-QUnit[ QUnit.jQuerySelectors && jQuery.fn.toggle && document.body.getRootNode ? "test" : "skip" ](
+QUnit[ QUnit.jQuerySelectors && jQuery.fn.toggle && !QUnit.isIE ? "test" : "skip" ](
"shadow toggle()", function( assert ) {
assert.expect( 4 );
@@ -1758,9 +1758,7 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) {
var div = jQuery( "<div>" ).appendTo( "#qunit-fixture" ),
$elem = jQuery( "<div>" ).addClass( "test__customProperties" )
.appendTo( "#qunit-fixture" ),
- webkitOrBlink = /\bsafari\b/i.test( navigator.userAgent ) &&
- !/\bfirefox\b/i.test( navigator.userAgent ) &&
- !/\bedge\b/i.test( navigator.userAgent ),
+ webkitOrBlink = /\bsafari\b/i.test( navigator.userAgent ),
expected = 10;
if ( webkitOrBlink ) {
diff --git a/test/unit/data.js b/test/unit/data.js
index 60ee017d6..301bee917 100644
--- a/test/unit/data.js
+++ b/test/unit/data.js
@@ -629,10 +629,6 @@ QUnit.test( ".data always sets data with the camelCased key (gh-2257)", function
key: "boolFalse",
value: false
},
-
- // JSHint enforces double quotes,
- // but JSON strings need double quotes to parse
- // so we need escaped double quotes here
"some-json": {
key: "someJson",
value: "{ \"foo\": \"bar\" }"
@@ -693,10 +689,6 @@ QUnit.test( ".data supports interoperable hyphenated/camelCase get/set of proper
key: "boolFalse",
value: false
},
-
- // JSHint enforces double quotes,
- // but JSON strings need double quotes to parse
- // so we need escaped double quotes here
"some-json": {
key: "someJson",
value: "{ \"foo\": \"bar\" }"
@@ -756,10 +748,6 @@ QUnit.test( ".data supports interoperable removal of hyphenated/camelCase proper
"an-object": {},
"bool-true": true,
"bool-false": false,
-
- // JSHint enforces double quotes,
- // but JSON strings need double quotes to parse
- // so we need escaped double quotes here
"some-json": "{ \"foo\": \"bar\" }"
};
@@ -797,10 +785,6 @@ QUnit.test( ".data supports interoperable removal of properties SET TWICE #13850
"an-object": {},
"bool-true": true,
"bool-false": false,
-
- // JSHint enforces double quotes,
- // but JSON strings need double quotes to parse
- // so we need escaped double quotes here
"some-json": "{ \"foo\": \"bar\" }"
};
diff --git a/test/unit/effects.js b/test/unit/effects.js
index 0acb393ce..2278b3afb 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -216,9 +216,9 @@ supportjQuery.each( hideOptions, function( type, setup ) {
clock.tick( 300 );
} );
- // Support: IE 11+, Edge 12 - 18+
- // IE/Edge don't support Shadow DOM.
- QUnit[ document.body.getRootNode ? "test" : "skip" ](
+ // Support: IE 11+
+ // IE doesn't support Shadow DOM.
+ QUnit.testUnlessIE(
"Persist correct display value - " + type + " hidden, shadow child", function( assert ) {
assert.expect( 3 );
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index 9058c1649..131109448 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -1762,13 +1762,9 @@ QUnit.test( "html(Function)", function( assert ) {
testHtml( manipulationFunctionReturningObj, assert );
} );
-QUnit[
- // Support: Edge 16 - 18+
- // Edge sometimes doesn't execute module scripts so skip the test there.
- ( QUnit.isIE || /edge\//i.test( navigator.userAgent ) ) ?
- "skip" :
- "test"
-]( "html(script type module)", function( assert ) {
+// Support: IE 9 - 11+
+// IE doesn't support modules.
+QUnit.testUnlessIE( "html(script type module)", function( assert ) {
assert.expect( 4 );
var done = assert.async(),
$fixture = jQuery( "#qunit-fixture" );
@@ -2897,12 +2893,7 @@ testIframe(
assert.equal( data, "", "No log request should be sent" );
supportjQuery.get( baseURL + "mock.php?action=cspClean" ).done( done );
} );
- },
-
- // Support: Edge <=18+
- // Edge doesn't support nonce in non-inline scripts.
- // See https://web.archive.org/web/20171203124125/https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13246371/
- QUnit[ /\bedge\//i.test( navigator.userAgent ) ? "skip" : "test" ]
+ }
);
testIframe(
@@ -2920,10 +2911,7 @@ testIframe(
},
// The AJAX module is needed for jQuery._evalUrl.
- // Support: Edge <=18+
- // Edge doesn't support nonce in non-inline scripts.
- // See https://web.archive.org/web/20171203124125/https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13246371/
- QUnit[ jQuery.ajax && !/\bedge\//i.test( navigator.userAgent ) ? "test" : "skip" ]
+ QUnit[ jQuery.ajax ? "test" : "skip" ]
);
testIframe(
@@ -2938,12 +2926,7 @@ testIframe(
assert.equal( data, "", "No log request should be sent" );
supportjQuery.get( baseURL + "mock.php?action=cspClean" ).done( done );
} );
- },
-
- // Support: Edge <=18+
- // Edge doesn't support nonce in non-inline scripts.
- // See https://web.archive.org/web/20171203124125/https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13246371/
- QUnit[ /\bedge\//i.test( navigator.userAgent ) ? "skip" : "test" ]
+ }
);
QUnit.test( "Sanitized HTML doesn't get unsanitized", function( assert ) {
diff --git a/test/unit/selector.js b/test/unit/selector.js
index 1111e2460..b11b801c6 100644
--- a/test/unit/selector.js
+++ b/test/unit/selector.js
@@ -1661,14 +1661,10 @@ QUnit.test( "context", function( assert ) {
}
} );
-// Support: IE 11+, Edge 12 - 18+
-// IE/Edge don't support the :scope pseudo-class so they will trigger MutationObservers.
+// Support: IE 11+
+// IE doesn't support the :scope pseudo-class so it will trigger MutationObservers.
// The test is skipped there.
-QUnit[
- ( QUnit.isIE || /edge\//i.test( navigator.userAgent ) ) ?
- "skip" :
- "test"
- ]( "selectors maintaining context don't trigger mutation observers", function( assert ) {
+QUnit.testUnlessIE( "selectors maintaining context don't trigger mutation observers", function( assert ) {
assert.expect( 1 );
var timeout,
@@ -1742,10 +1738,10 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "disconnected nodes", function
assert.equal( $opt.is( ":selected" ), true, "selected option" );
} );
-// Support: IE 11+, Edge 12 - 18+
-// IE/Edge don't support Shadow DOM.
+// Support: IE 11+
+// IE doesn't support Shadow DOM.
// selector-native doesn't support querying inside of Shadow DOM.
-QUnit[ QUnit.jQuerySelectors && document.body.getRootNode ? "test" : "skip" ](
+QUnit[ QUnit.jQuerySelectors && !QUnit.isIE ? "test" : "skip" ](
"Shadow DOM nodes supported as root", function( assert ) {
assert.expect( 2 );
diff --git a/test/unit/support.js b/test/unit/support.js
index b2d4eb350..008453085 100644
--- a/test/unit/support.js
+++ b/test/unit/support.js
@@ -58,39 +58,18 @@ testIframe(
var expected,
userAgent = window.navigator.userAgent,
expectedMap = {
- edge: {
- reliableTrDimensions: false,
- scope: undefined
- },
- ie_11: {
- reliableTrDimensions: false,
- scope: undefined
- },
- chrome: {
- reliableTrDimensions: true,
- scope: true
- },
- safari: {
- reliableTrDimensions: true,
- scope: true
- },
- firefox: {
- reliableTrDimensions: true,
- scope: true
- },
- ios: {
- reliableTrDimensions: true,
- scope: true
- }
+ ie_11: {},
+ chrome: {},
+ safari: {},
+ firefox: {},
+ ios: {}
};
- if ( /edge\//i.test( userAgent ) ) {
- expected = expectedMap.edge;
- } else if ( document.documentMode ) {
+ if ( document.documentMode ) {
expected = expectedMap.ie_11;
} else if ( /chrome/i.test( userAgent ) ) {
- // Catches Chrome on Android & Opera as well.
+ // Catches Edge, Chrome on Android & Opera as well.
expected = expectedMap.chrome;
} else if ( /\b\d+(\.\d+)+ safari/i.test( userAgent ) ) {
expected = expectedMap.safari;