Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
move checkbox radio property checks to jQuery.fn.prop
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Dec 19, 2012
1 parent 3571bed commit 3325c16
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/unit/checkboxradio/checkboxradio_core.js
Expand Up @@ -10,20 +10,20 @@

input.checkboxradio( "disable" );
input.checkboxradio( "enable" );
ok( !input.attr( "disabled" ), "start input as enabled" );
ok( !input.prop("disabled"), "start input as enabled" );
ok( !input.parent().hasClass( "ui-disabled" ), "no disabled styles" );
ok( !input.attr( "checked" ), "not checked before click" );
ok( !input.prop("checked"), "not checked before click" );
button.trigger( "click" );
ok( input.attr( "checked" ), "checked after click" );
ok( input.prop("checked"), "checked after click" );
ok( button.hasClass( "ui-checkbox-on" ), "active styles after click" );
button.trigger( "click" );

input.checkboxradio( "disable" );
ok( input.attr( "disabled" ), "input disabled" );
ok( input.parent().hasClass( "ui-disabled" ), "disabled styles" );
ok( !input.attr( "checked" ), "not checked before click" );
ok( !input.prop( "checked" ), "not checked before click" );
button.trigger( "click" );
ok( !input.attr( "checked" ), "not checked after click" );
ok( !input.prop( "checked" ), "not checked after click" );
ok( !button.hasClass( "ui-checkbox-on" ), "no active styles after click" );
});

Expand All @@ -33,16 +33,16 @@
var input2 = $("#checkbox-32");
var button2 = input2.parent().find(".ui-btn");

ok(!input1.attr("checked"), "input1 not checked before click");
ok(!input2.attr("checked"), "input2 not checked before click");
ok(!input1.prop("checked"), "input1 not checked before click");
ok(!input2.prop("checked"), "input2 not checked before click");

button1.trigger("click");
ok(input1.attr("checked"), "input1 checked after click on input1");
ok(!input2.attr("checked"), "input2 not checked after click on input1");
ok(input1.prop("checked"), "input1 checked after click on input1");
ok(!input2.prop("checked"), "input2 not checked after click on input1");

button2.trigger("click");
ok(input1.attr("checked"), "input1 not changed after click on input2");
ok(input2.attr("checked"), "input2 checked after click on input2");
ok(input1.prop("checked"), "input1 not changed after click on input2");
ok(input2.prop("checked"), "input2 checked after click on input2");
});

asyncTest( "change events fired on checkbox for both check and uncheck", function(){
Expand Down

0 comments on commit 3325c16

Please sign in to comment.