});
});
-test( "disable", function() {
- expect( 16 );
+test( "disable", function( assert ) {
+ expect( 15 );
var element = $( "#spin" ).val( 2 ).spinner(),
wrapper = $( "#spin" ).spinner( "widget" );
- ok( !wrapper.hasClass( "ui-spinner-disabled" ), "before: wrapper does not have ui-spinner-disabled class" );
+ assert.lacksClasses( wrapper, "ui-spinner-disabled" );
ok( !element.is( ":disabled" ), "before: input does not have disabled attribute" );
element.spinner( "disable" );
- ok( wrapper.hasClass( "ui-spinner-disabled" ), "after: wrapper has ui-spinner-disabled class" );
- ok( wrapper.hasClass( "ui-state-disabled" ), "after: wrapper has ui-state-disabled class" );
+ assert.hasClasses( wrapper, "ui-state-disabled ui-spinner-disabled" );
ok( !wrapper.attr( "aria-disabled" ), "after: wrapper does not have aria-disabled attr" );
ok( element.is( ":disabled"), "after: input has disabled attribute" );
equal( 7, element.val(), "script - pageDown 1 page changes value" );
});
-test( "enable", function() {
+test( "enable", function( assert ) {
expect( 5 );
var element = $( "#spin" ).val( 1 ).spinner({ disabled: true }),
wrapper = element.spinner( "widget" );
- ok( wrapper.hasClass( "ui-spinner-disabled" ), "before: wrapper has ui-spinner-disabled class" );
+ assert.hasClasses( wrapper, "ui-spinner-disabled" );
ok( element.is( ":disabled" ), "before: input has disabled attribute" );
element.spinner( "enable" );
- ok( !wrapper.hasClass( ".ui-spinner-disabled" ), "after: wrapper does not have ui-spinner-disabled class" );
+ assert.lacksClasses( wrapper, "ui-spinner-disabled" );
ok( !element.is( ":disabled" ), "after: input does not have disabled attribute" );
simulateKeyDownUp( element, $.ui.keyCode.UP );
// culture is tested after numberFormat, since it depends on numberFormat
-test( "icons: default ", function() {
+test( "icons: default ", function( assert ) {
expect( 4 );
var element = $( "#spin" ).val( 0 ).spinner();
- equal( element.spinner( "widget" ).find( ".ui-icon:first" ).attr( "class" ), "ui-icon ui-icon-triangle-1-n" );
- equal( element.spinner( "widget" ).find( ".ui-icon:last" ).attr( "class" ), "ui-icon ui-icon-triangle-1-s" );
+ assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon:first" ),
+ "ui-icon ui-icon-triangle-1-n" );
+ assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon:last" ),
+ "ui-icon ui-icon-triangle-1-s" );
element.spinner( "option", "icons", {
up: "ui-icon-caret-1-n",
down: "ui-icon-caret-1-s"
});
- equal( element.spinner( "widget" ).find( ".ui-icon:first" ).attr( "class" ), "ui-icon ui-icon-caret-1-n" );
- equal( element.spinner( "widget" ).find( ".ui-icon:last" ).attr( "class" ), "ui-icon ui-icon-caret-1-s" );
+ assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon:first" ),
+ "ui-icon ui-icon-caret-1-n" );
+ assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon:last" ),
+ "ui-icon ui-icon-caret-1-s" );
});
-test( "icons: custom ", function() {
+test( "icons: custom ", function( assert ) {
expect( 2 );
var element = $( "#spin" ).val( 0 ).spinner({
icons: {
up: "custom-up"
}
}).spinner( "widget" );
- equal( element.find( ".ui-icon:first" ).attr( "class" ), "ui-icon custom-up" );
- equal( element.find( ".ui-icon:last" ).attr( "class" ), "ui-icon custom-down" );
+ assert.hasClasses( element.find( ".ui-icon:first" ), "ui-icon custom-up" );
+ assert.hasClasses( element.find( ".ui-icon:last" ), "ui-icon custom-down" );
});
test( "incremental, false", function() {