",
"",
""
];
$.each( groups, function( index, markup ) {
var group = $( markup );
group.find( "input[type=checkbox]" ).checkboxradio();
assert.hasClasses( group.find( "label" ), "ui-button" );
} );
});
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" );
assert.raises(
function() {
$( "" ).checkboxradio();
},
error,
"Proper error thrown"
);
error = new Error( "Can't create checkboxradio on element.nodeName=input and element.type=button" );
assert.raises(
function() {
$( "" ).checkboxradio();
},
error,
"Proper error thrown"
);
});
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" );
assert.raises(
function() {
$( "" ).checkboxradio();
},
error,
"Proper error thrown"
);
});
} );