aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
authorTimmy Willison <4timmywil@gmail.com>2016-09-12 12:32:02 -0400
committerTimmy Willison <4timmywil@gmail.com>2016-09-15 10:40:27 -0400
commit3bbcce68d7b8b8a7a2164a0f7a280ae9daf70b5c (patch)
treea65aefeef8aa62ff092254dcd5b1f2c256dc82ea /test/unit/ajax.js
parent2d4f53416e5f74fa98e0c1d66b6f3c285a12f0ce (diff)
downloadjquery-3bbcce68d7b8b8a7a2164a0f7a280ae9daf70b5c.tar.gz
jquery-3bbcce68d7b8b8a7a2164a0f7a280ae9daf70b5c.zip
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
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r--test/unit/ajax.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 5a3bd32d2..681aa463b 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -2327,6 +2327,17 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
} );
} );
+ // Selector should be trimmed to avoid leading spaces (#14773)
+ // Selector should include any valid non-HTML whitespace (#3003)
+ QUnit.test( "jQuery.fn.load( URL_SELECTOR with non-HTML whitespace(#3003) )", function( assert ) {
+ assert.expect( 1 );
+ var done = assert.async();
+ jQuery( "#first" ).load( "data/test3.html #whitespace\\\\xA0 ", function() {
+ assert.strictEqual( jQuery( this ).children( "div" ).length, 1, "Verify that specific elements were injected" );
+ done();
+ } );
+ } );
+
QUnit.asyncTest( "jQuery.fn.load( String, Function ) - simple: inject text into DOM", 2, function( assert ) {
jQuery( "#first" ).load( url( "data/name.html" ), function() {
assert.ok( /^ERROR/.test( jQuery( "#first" ).text() ), "Check if content was injected into the DOM" );