From d4719bf6160a0c99273abddc42e39a734e9943a2 Mon Sep 17 00:00:00 2001 From: Alexander Schmitz Date: Thu, 14 May 2015 08:37:53 -0400 Subject: Spinner: Deprecate _uiSpinnerHtml and _buttonHtml extension points Fixes #11097 Closes gh-1560 --- tests/unit/spinner/common-deprecated.js | 35 ++++++++++++++++++++++++++++ tests/unit/spinner/deprecated.html | 21 +++++++++++++++++ tests/unit/spinner/deprecated.js | 41 +++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 tests/unit/spinner/common-deprecated.js create mode 100644 tests/unit/spinner/deprecated.html create mode 100644 tests/unit/spinner/deprecated.js (limited to 'tests/unit') diff --git a/tests/unit/spinner/common-deprecated.js b/tests/unit/spinner/common-deprecated.js new file mode 100644 index 000000000..2c40df76a --- /dev/null +++ b/tests/unit/spinner/common-deprecated.js @@ -0,0 +1,35 @@ +define( [ + "lib/common", + "ui/spinner" +], function( common ) { + +common.testWidget( "spinner", { + defaults: { + classes: { + "ui-spinner": "ui-corner-all", + "ui-spinner-up": "ui-corner-tr", + "ui-spinner-down": "ui-corner-br" + }, + culture: null, + disabled: false, + icons: { + down: "ui-icon-triangle-1-s", + up: "ui-icon-triangle-1-n" + }, + incremental: true, + max: null, + min: null, + numberFormat: null, + page: 10, + step: 1, + + // callbacks + change: null, + create: null, + spin: null, + start: null, + stop: null + } +}); + +} ); diff --git a/tests/unit/spinner/deprecated.html b/tests/unit/spinner/deprecated.html new file mode 100644 index 000000000..a6c249a17 --- /dev/null +++ b/tests/unit/spinner/deprecated.html @@ -0,0 +1,21 @@ + + + + + jQuery UI Spinner Test Suite + + + + + + + +
+
+ + + + +
+ + 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 ""; + }, + + _buttonHtml: function() { + return "" + + "" + + "" + + "" + + "" + + "" + + ""; + } + } ); + }, + + 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" ); +} ); + +} ); -- cgit v1.2.3