diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-02-28 15:56:32 +0100 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-02-29 18:36:40 +0100 |
commit | 72023dd045a7fead5a3136ec2400ad4743a190d2 (patch) | |
tree | 4999a287a815e6a4200498a2a0241abc349fe599 /tests/unit/button | |
parent | e6b7486abf2e0f98837e76027084fad6fe908cff (diff) | |
download | jquery-ui-72023dd045a7fead5a3136ec2400ad4743a190d2.tar.gz jquery-ui-72023dd045a7fead5a3136ec2400ad4743a190d2.zip |
Update to QUnit 1.3. Replace usage of same with deepEqual and equals with equal.
Diffstat (limited to 'tests/unit/button')
-rw-r--r-- | tests/unit/button/button_core.js | 24 | ||||
-rw-r--r-- | tests/unit/button/button_options.js | 38 |
2 files changed, 31 insertions, 31 deletions
diff --git a/tests/unit/button/button_core.js b/tests/unit/button/button_core.js index 692c40320..c110b4311 100644 --- a/tests/unit/button/button_core.js +++ b/tests/unit/button/button_core.js @@ -10,7 +10,7 @@ module("button: core"); test("checkbox", function() { var input = $("#check"); label = $("label[for=check]"); - ok( input.is(":visible") ); + ok( input.is(":visible") ); ok( label.is(":not(.ui-button)") ); input.button(); ok( input.is(".ui-helper-hidden-accessible") ); @@ -20,7 +20,7 @@ test("checkbox", function() { test("radios", function() { var inputs = $("#radio0 input"); labels = $("#radio0 label"); - ok( inputs.is(":visible") ); + ok( inputs.is(":visible") ); ok( labels.is(":not(.ui-button)") ); inputs.button(); ok( inputs.is(".ui-helper-hidden-accessible") ); @@ -36,15 +36,15 @@ function assert(noForm, form1, form2) { test("radio groups", function() { $(":radio").button(); assert(":eq(0)", ":eq(1)", ":eq(2)"); - + // click outside of forms $("#radio0 .ui-button:eq(1)").click(); assert(":eq(1)", ":eq(1)", ":eq(2)"); - + // click in first form $("#radio1 .ui-button:eq(0)").click(); assert(":eq(1)", ":eq(0)", ":eq(2)"); - + // click in second form $("#radio2 .ui-button:eq(0)").click(); assert(":eq(1)", ":eq(0)", ":eq(0)"); @@ -52,16 +52,16 @@ test("radio groups", function() { test("input type submit, don't create child elements", function() { var input = $("#submit") - same( input.children().length, 0 ); + deepEqual( input.children().length, 0 ); input.button(); - same( input.children().length, 0 ); + deepEqual( input.children().length, 0 ); }); test("buttonset", function() { var set = $("#radio1").buttonset(); ok( set.is(".ui-buttonset") ); - same( set.children(".ui-button").length, 3 ); - same( set.children("input:radio.ui-helper-hidden-accessible").length, 3 ); + deepEqual( set.children(".ui-button").length, 3 ); + deepEqual( set.children("input:radio.ui-helper-hidden-accessible").length, 3 ); ok( set.children("label:eq(0)").is(".ui-button.ui-corner-left:not(.ui-corner-all)") ); ok( set.children("label:eq(1)").is(".ui-button:not(.ui-corner-all)") ); ok( set.children("label:eq(2)").is(".ui-button.ui-corner-right:not(.ui-corner-all)") ); @@ -71,11 +71,11 @@ test("buttonset (rtl)", function() { var parent = $("#radio1").parent(); // Set to rtl parent.attr("dir", "rtl"); - + var set = $("#radio1").buttonset(); ok( set.is(".ui-buttonset") ); - same( set.children(".ui-button").length, 3 ); - same( set.children("input:radio.ui-helper-hidden-accessible").length, 3 ); + deepEqual( set.children(".ui-button").length, 3 ); + deepEqual( set.children("input:radio.ui-helper-hidden-accessible").length, 3 ); ok( set.children("label:eq(0)").is(".ui-button.ui-corner-right:not(.ui-corner-all)") ); ok( set.children("label:eq(1)").is(".ui-button:not(.ui-corner-all)") ); ok( set.children("label:eq(2)").is(".ui-button.ui-corner-left:not(.ui-corner-all)") ); diff --git a/tests/unit/button/button_options.js b/tests/unit/button/button_options.js index a3ab5ae10..9ef4a19db 100644 --- a/tests/unit/button/button_options.js +++ b/tests/unit/button/button_options.js @@ -7,26 +7,26 @@ module("button: options"); test("disabled, explicit value", function() { $("#radio01").button({ disabled: false }); - same(false, $("#radio01").button("option", "disabled"), + deepEqual(false, $("#radio01").button("option", "disabled"), "disabled option set to false"); - same(false, $("#radio01").prop("disabled"), "element is disabled"); - + deepEqual(false, $("#radio01").prop("disabled"), "element is disabled"); + $("#radio02").button({ disabled: true }); - same(true, $("#radio02").button("option", "disabled"), + deepEqual(true, $("#radio02").button("option", "disabled"), "disabled option set to true"); - same(true, $("#radio02").prop("disabled"), "element is not disabled"); + deepEqual(true, $("#radio02").prop("disabled"), "element is not disabled"); }); test("disabled, null", function() { $("#radio01").button({ disabled: null }); - same(false, $("#radio01").button("option", "disabled"), + deepEqual(false, $("#radio01").button("option", "disabled"), "disabled option set to false"); - same(false, $("#radio01").prop("disabled"), "element is disabled"); - + deepEqual(false, $("#radio01").prop("disabled"), "element is disabled"); + $("#radio02").prop("disabled", true).button({ disabled: null }); - same(true, $("#radio02").button("option", "disabled"), + deepEqual(true, $("#radio02").button("option", "disabled"), "disabled option set to true"); - same(true, $("#radio02").prop("disabled"), "element is not disabled"); + deepEqual(true, $("#radio02").prop("disabled"), "element is not disabled"); }); test("text false without icon", function() { @@ -34,7 +34,7 @@ test("text false without icon", function() { text: false }); ok( $("#button").is(".ui-button-text-only:not(.ui-button-icon-only)") ); - + $("#button").button("destroy"); }); @@ -46,14 +46,14 @@ test("text false with icon", function() { } }); ok( $("#button").is(".ui-button-icon-only:not(.ui-button-text):has(span.ui-icon.iconclass)") ); - + $("#button").button("destroy"); }); test("label, default", function() { $("#button").button(); - same( $("#button").text(), "Label" ); - + deepEqual( $("#button").text(), "Label" ); + $("#button").button("destroy"); }); @@ -61,20 +61,20 @@ test("label", function() { $("#button").button({ label: "xxx" }); - same( $("#button").text(), "xxx" ); - + deepEqual( $("#button").text(), "xxx" ); + $("#button").button("destroy"); }); test("label default with input type submit", function() { - same( $("#submit").button().val(), "Label" ); + deepEqual( $("#submit").button().val(), "Label" ); }); test("label with input type submit", function() { var label = $("#submit").button({ label: "xxx" }).val(); - same( label, "xxx" ); + deepEqual( label, "xxx" ); }); test("icons", function() { @@ -86,7 +86,7 @@ test("icons", function() { } }); ok( $("#button").is(":has(span.ui-icon.ui-button-icon-primary.iconclass):has(span.ui-icon.ui-button-icon-secondary.iconclass2)") ); - + $("#button").button("destroy"); }); |