aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/button
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-06-27 11:32:48 -0400
committerScott González <scott.gonzalez@gmail.com>2012-06-27 11:32:48 -0400
commit5ae668fdb61dd5e516dc599166a31fd46a916bfd (patch)
tree002c635b5410177d4de10c2288230fdd0bbcdbab /tests/unit/button
parent9b6c1c5cdb18d76d9febfc079a1cc439dc3789b3 (diff)
downloadjquery-ui-5ae668fdb61dd5e516dc599166a31fd46a916bfd.tar.gz
jquery-ui-5ae668fdb61dd5e516dc599166a31fd46a916bfd.zip
Tests: Enable QUnit.config.requireExpects.
Diffstat (limited to 'tests/unit/button')
-rw-r--r--tests/unit/button/button_core.js6
-rw-r--r--tests/unit/button/button_options.js9
-rw-r--r--tests/unit/button/button_tickets.js5
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit/button/button_core.js b/tests/unit/button/button_core.js
index c274a8473..f3c50d840 100644
--- a/tests/unit/button/button_core.js
+++ b/tests/unit/button/button_core.js
@@ -8,6 +8,7 @@
module("button: core");
test("checkbox", function() {
+ expect( 4 );
var input = $("#check"),
label = $("label[for=check]");
ok( input.is(":visible") );
@@ -18,6 +19,7 @@ test("checkbox", function() {
});
test("radios", function() {
+ expect( 4 );
var inputs = $("#radio0 input"),
labels = $("#radio0 label");
ok( inputs.is(":visible") );
@@ -34,6 +36,7 @@ function assert(noForm, form1, form2) {
}
test("radio groups", function() {
+ expect( 12 );
$("input[type=radio]").button();
assert(":eq(0)", ":eq(1)", ":eq(2)");
@@ -51,6 +54,7 @@ test("radio groups", function() {
});
test("input type submit, don't create child elements", function() {
+ expect( 2 );
var input = $("#submit");
deepEqual( input.children().length, 0 );
input.button();
@@ -58,6 +62,7 @@ test("input type submit, don't create child elements", function() {
});
test("buttonset", function() {
+ expect( 6 );
var set = $("#radio1").buttonset();
ok( set.is(".ui-buttonset") );
deepEqual( set.children(".ui-button").length, 3 );
@@ -68,6 +73,7 @@ test("buttonset", function() {
});
test("buttonset (rtl)", function() {
+ expect( 6 );
var set,
parent = $("#radio1").parent();
// Set to rtl
diff --git a/tests/unit/button/button_options.js b/tests/unit/button/button_options.js
index 3dd361ac9..eeb6e5527 100644
--- a/tests/unit/button/button_options.js
+++ b/tests/unit/button/button_options.js
@@ -6,6 +6,7 @@
module("button: options");
test("disabled, explicit value", function() {
+ expect( 4 );
$("#radio01").button({ disabled: false });
deepEqual(false, $("#radio01").button("option", "disabled"),
"disabled option set to false");
@@ -18,6 +19,7 @@ test("disabled, explicit value", function() {
});
test("disabled, null", function() {
+ expect( 4 );
$("#radio01").button({ disabled: null });
deepEqual(false, $("#radio01").button("option", "disabled"),
"disabled option set to false");
@@ -30,6 +32,7 @@ test("disabled, null", function() {
});
test("text false without icon", function() {
+ expect( 1 );
$("#button").button({
text: false
});
@@ -39,6 +42,7 @@ test("text false without icon", function() {
});
test("text false with icon", function() {
+ expect( 1 );
$("#button").button({
text: false,
icons: {
@@ -51,6 +55,7 @@ test("text false with icon", function() {
});
test("label, default", function() {
+ expect( 2 );
$("#button").button();
deepEqual( $("#button").text(), "Label" );
deepEqual( $( "#button").button( "option", "label" ), "Label" );
@@ -59,6 +64,7 @@ test("label, default", function() {
});
test("label", function() {
+ expect( 2 );
$("#button").button({
label: "xxx"
});
@@ -69,11 +75,13 @@ test("label", function() {
});
test("label default with input type submit", function() {
+ expect( 2 );
deepEqual( $("#submit").button().val(), "Label" );
deepEqual( $("#submit").button( "option", "label" ), "Label" );
});
test("label with input type submit", function() {
+ expect( 2 );
var label = $("#submit").button({
label: "xxx"
}).val();
@@ -82,6 +90,7 @@ test("label with input type submit", function() {
});
test("icons", function() {
+ expect( 1 );
$("#button").button({
text: false,
icons: {
diff --git a/tests/unit/button/button_tickets.js b/tests/unit/button/button_tickets.js
index fe0d82fd6..846ca7ef4 100644
--- a/tests/unit/button/button_tickets.js
+++ b/tests/unit/button/button_tickets.js
@@ -6,6 +6,7 @@
module( "button: tickets" );
test( "#5946 - buttonset should ignore buttons that are not :visible", function() {
+ expect( 2 );
$( "#radio01" ).next().andSelf().hide();
var set = $( "#radio0" ).buttonset({ items: "input[type=radio]:visible" });
ok( set.find( "label:eq(0)" ).is( ":not(.ui-button):not(.ui-corner-left)" ) );
@@ -13,6 +14,7 @@ test( "#5946 - buttonset should ignore buttons that are not :visible", function(
});
test( "#6262 - buttonset not applying ui-corner to invisible elements", function() {
+ expect( 3 );
$( "#radio0" ).hide();
var set = $( "#radio0" ).buttonset();
ok( set.find( "label:eq(0)" ).is( ".ui-button.ui-corner-left" ) );
@@ -21,6 +23,7 @@ test( "#6262 - buttonset not applying ui-corner to invisible elements", function
});
test( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard Navigation", function() {
+ expect( 2 );
var check = $( "#check" ).button(),
label = $( "label[for='check']" );
ok( !label.is( ".ui-state-focus" ) );
@@ -29,6 +32,7 @@ test( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard
});
test( "#7092 - button creation that requires a matching label does not find label in all cases", function() {
+ expect( 5 );
var group = $( "<span><label for='t7092a'></label><input type='checkbox' id='t7092a'></span>" );
group.find( "input[type=checkbox]" ).button();
ok( group.find( "label" ).is( ".ui-button" ) );
@@ -51,6 +55,7 @@ test( "#7092 - button creation that requires a matching label does not find labe
});
test( "#7534 - Button label selector works for ids with \":\"", function() {
+ expect( 1 );
var group = $( "<span><input type='checkbox' id='check:7534'><label for='check:7534'>Label</label></span>" );
group.find( "input" ).button();
ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" );