aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-10-28 09:23:28 -0400
committerScott González <scott.gonzalez@gmail.com>2015-10-28 09:23:28 -0400
commit65f41762499ce3b924e52cfb16a069ffbc36521f (patch)
treeeec849a576c8395e8055818d91a58dc0922bb126
parenta640fae24e834ea509e60c75325c195f78d88741 (diff)
downloadjquery-ui-65f41762499ce3b924e52cfb16a069ffbc36521f.tar.gz
jquery-ui-65f41762499ce3b924e52cfb16a069ffbc36521f.zip
Checkboxradio: Fix error tests with jQuery 1.7.0
-rw-r--r--tests/unit/checkboxradio/core.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/unit/checkboxradio/core.js b/tests/unit/checkboxradio/core.js
index ac4f2705a..15cfc155b 100644
--- a/tests/unit/checkboxradio/core.js
+++ b/tests/unit/checkboxradio/core.js
@@ -72,25 +72,28 @@ test( "Checkbox creation requires a label, and finds it in all cases", function(
test( "Calling checkboxradio on an unsupported element throws an error", function( assert ) {
expect( 2 );
- var error = new Error(
- "Can't create checkboxradio on element.nodeName=div and element.type=undefined"
- );
+ var errorMessage =
+ "Can't create checkboxradio on element.nodeName=div and element.type=undefined";
+ var error = new Error( errorMessage );
assert.raises(
function() {
$( "<div>" ).checkboxradio();
},
- error,
+
+ // Support: jQuery 1.7.0 only
+ $.fn.jquery === "1.7" ? errorMessage : error,
"Proper error thrown"
);
- error = new Error(
- "Can't create checkboxradio on element.nodeName=input and element.type=button"
- );
+ errorMessage = "Can't create checkboxradio on element.nodeName=input and element.type=button";
+ error = new Error( errorMessage );
assert.raises(
function() {
$( "<input type='button'>" ).checkboxradio();
},
- error,
+
+ // Support: jQuery 1.7.0 only
+ $.fn.jquery === "1.7" ? errorMessage : error,
"Proper error thrown"
);
} );
@@ -98,12 +101,15 @@ test( "Calling checkboxradio on an unsupported element throws an error", functio
test( "Calling checkboxradio on an input with no label throws an error", function( assert ) {
expect( 1 );
- var error = new Error( "No label found for checkboxradio widget" );
+ var errorMessage = "No label found for checkboxradio widget";
+ var error = new Error( errorMessage );
assert.raises(
function() {
$( "<input type='checkbox'>" ).checkboxradio();
},
- error,
+
+ // Support: jQuery 1.7.0 only
+ $.fn.jquery === "1.7" ? errorMessage : error,
"Proper error thrown"
);
} );