aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2015-02-24 16:17:29 -0500
committerAlexander Schmitz <arschmitz@gmail.com>2015-03-11 16:05:23 -0400
commit28dccda3776c586052d787dd77e0abdbf1b68a0d (patch)
tree957710112edcab329c2b88260a543c78291a4378 /tests
parent90c27b4b5130fff9abbfea671c193c59e4bf8850 (diff)
downloadjquery-ui-28dccda3776c586052d787dd77e0abdbf1b68a0d.tar.gz
jquery-ui-28dccda3776c586052d787dd77e0abdbf1b68a0d.zip
Spinner: Add classes option
Ref #7053 Ref gh-1411
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/spinner/spinner.html1
-rw-r--r--tests/unit/spinner/spinner_common.js6
-rw-r--r--tests/unit/spinner/spinner_core.js15
3 files changed, 21 insertions, 1 deletions
diff --git a/tests/unit/spinner/spinner.html b/tests/unit/spinner/spinner.html
index 58988d742..c427f5de5 100644
--- a/tests/unit/spinner/spinner.html
+++ b/tests/unit/spinner/spinner.html
@@ -11,6 +11,7 @@
<script src="../../../external/qunit/qunit.js"></script>
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script>
<script src="../testsuite.js"></script>
+ <script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script>
<script>
TestHelpers.loadResources({
css: [ "core", "button", "spinner" ],
diff --git a/tests/unit/spinner/spinner_common.js b/tests/unit/spinner/spinner_common.js
index 871af7db4..3eee4f9f0 100644
--- a/tests/unit/spinner/spinner_common.js
+++ b/tests/unit/spinner/spinner_common.js
@@ -1,6 +1,10 @@
TestHelpers.commonWidgetTests( "spinner", {
defaults: {
- classes: {},
+ classes: {
+ "ui-spinner": "ui-corner-all",
+ "ui-spinner-up": "ui-corner-tr",
+ "ui-spinner-down": "ui-corner-br"
+ },
culture: null,
disabled: false,
icons: {
diff --git a/tests/unit/spinner/spinner_core.js b/tests/unit/spinner/spinner_core.js
index 03088fecd..b3e1e6d23 100644
--- a/tests/unit/spinner/spinner_core.js
+++ b/tests/unit/spinner/spinner_core.js
@@ -4,6 +4,21 @@ var simulateKeyDownUp = TestHelpers.spinner.simulateKeyDownUp;
module( "spinner: core" );
+test( "markup structure", function( assert ) {
+ expect( 6 );
+ var element = $( "#spin" ).spinner(),
+ spinner = element.spinner( "widget" ),
+ up = spinner.find( ".ui-spinner-up" ),
+ down = spinner.find( ".ui-spinner-down" );
+
+ assert.hasClasses( element, "ui-spinner-input" );
+ assert.hasClasses( spinner, "ui-spinner ui-widget ui-widget-content" );
+ assert.hasClasses( up, "ui-spinner-button ui-spinner-up ui-widget" );
+ equal( up.length, 1, "Spinner contains exactly one up button" );
+ assert.hasClasses( down, "ui-spinner-button ui-spinner-down ui-widget" );
+ equal( down.length, 1, "Spinner contains exactly one down button" );
+});
+
test( "keydown UP on input, increases value not greater than max", function() {
expect( 5 );
var element = $( "#spin" ).val( 70 ).spinner({