jquery-ui/tests/unit/spinner/deprecated.js

45 lines
1.1 KiB
JavaScript
Raw Normal View History

define( [
2016-04-06 13:26:05 +00:00
"qunit",
"jquery",
"lib/helper",
"ui/widgets/spinner"
], function( QUnit, $, helper ) {
var originalSpinner = $.ui.spinner.prototype;
2016-04-06 13:26:05 +00:00
QUnit.module( "spinner: deprecated", {
beforeEach: function() {
$.widget( "ui.spinner", $.ui.spinner, {
_uiSpinnerHtml: function() {
return "<span class='spin-wrap'>";
},
_buttonHtml: function() {
return "" +
"<a class='spin-up'>" +
"<span>&#9650;</span>" +
"</a>" +
"<a>" +
"<span>&#9660;</span>" +
"</a>";
}
} );
},
2016-04-06 13:26:05 +00:00
afterEach: function() {
$.ui.spinner.prototype = originalSpinner;
return helper.moduleAfterEach.apply( this, arguments );
}
} );
2016-04-06 13:26:05 +00:00
QUnit.test( "markup structure - custom", function( assert ) {
assert.expect( 2 );
var element = $( "#spin" ).spinner(),
spinner = element.spinner( "widget" ),
up = spinner.find( ".ui-spinner-up" );
assert.hasClasses( spinner, "ui-spinner ui-widget ui-widget-content spin-wrap", "_uiSpinnerHtml() overides default markup" );
assert.hasClasses( up, "ui-spinner-button ui-spinner-up ui-widget spin-up", "_ButtonHtml() overides default markup" );
} );
} );