aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/spinner/deprecated.js
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2015-05-14 08:37:53 -0400
committerAlexander Schmitz <arschmitz@gmail.com>2015-06-03 08:37:45 -0400
commitd4719bf6160a0c99273abddc42e39a734e9943a2 (patch)
treee9dc48912370ecf7f781e1df554c23ed33cf52f8 /tests/unit/spinner/deprecated.js
parentc2224bf5dc418c84c185844611786b9ccfb869a7 (diff)
downloadjquery-ui-d4719bf6160a0c99273abddc42e39a734e9943a2.tar.gz
jquery-ui-d4719bf6160a0c99273abddc42e39a734e9943a2.zip
Spinner: Deprecate _uiSpinnerHtml and _buttonHtml extension points
Fixes #11097 Closes gh-1560
Diffstat (limited to 'tests/unit/spinner/deprecated.js')
-rw-r--r--tests/unit/spinner/deprecated.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/unit/spinner/deprecated.js b/tests/unit/spinner/deprecated.js
new file mode 100644
index 000000000..c45a053fd
--- /dev/null
+++ b/tests/unit/spinner/deprecated.js
@@ -0,0 +1,41 @@
+define( [
+ "jquery",
+ "ui/spinner"
+], function( $ ) {
+
+var originalSpinner = $.ui.spinner.prototype;
+module( "spinner: deprecated", {
+ setup: 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>";
+ }
+ } );
+ },
+
+ teardown: function() {
+ $.ui.spinner.prototype = originalSpinner;
+ }
+} );
+
+test( "markup structure - custom", function( 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" );
+} );
+
+} );