diff options
author | Alexander Schmitz <arschmitz@gmail.com> | 2014-12-03 11:27:19 -0500 |
---|---|---|
committer | Alexander Schmitz <arschmitz@gmail.com> | 2015-03-11 16:05:12 -0400 |
commit | 491bb9c7f4929eb574e0ab6116a5b22562446734 (patch) | |
tree | 162ba5422860c541d93c29d888a64c4b21c22bb1 /tests/unit | |
parent | 3483486a153f6f7b3a8bbe9783735eb63adfd033 (diff) | |
download | jquery-ui-491bb9c7f4929eb574e0ab6116a5b22562446734.tar.gz jquery-ui-491bb9c7f4929eb574e0ab6116a5b22562446734.zip |
Slider: Add classes option
Ref #7053
Ref gh-1411
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/slider/slider.html | 1 | ||||
-rw-r--r-- | tests/unit/slider/slider_common.js | 6 | ||||
-rw-r--r-- | tests/unit/slider/slider_core.js | 12 |
3 files changed, 18 insertions, 1 deletions
diff --git a/tests/unit/slider/slider.html b/tests/unit/slider/slider.html index 0142b5e6b..38520c073 100644 --- a/tests/unit/slider/slider.html +++ b/tests/unit/slider/slider.html @@ -9,6 +9,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", "slider" ], diff --git a/tests/unit/slider/slider_common.js b/tests/unit/slider/slider_common.js index a72071f79..d43869bf0 100644 --- a/tests/unit/slider/slider_common.js +++ b/tests/unit/slider/slider_common.js @@ -2,7 +2,11 @@ TestHelpers.commonWidgetTests( "slider", { defaults: { animate: false, cancel: "input,textarea,button,select,option", - classes: {}, + classes: { + "ui-slider": "ui-corner-all", + "ui-slider-handle": "ui-corner-all", + "ui-slider-range": "ui-corner-all ui-widget-header" + }, delay: 0, disabled: false, distance: 0, diff --git a/tests/unit/slider/slider_core.js b/tests/unit/slider/slider_core.js index 3649bded0..fa86b2df4 100644 --- a/tests/unit/slider/slider_core.js +++ b/tests/unit/slider/slider_core.js @@ -12,6 +12,18 @@ function handle() { // Slider Tests module( "slider: core" ); +test( "markup structure", function( assert ) { + expect( 4 ); + var element = $( "<div>" ).slider({ range: true }), + handle = element.find( "span" ), + range = element.find( "div" ); + + assert.hasClasses( element, "ui-slider ui-slider-horizontal ui-widget ui-widget-content" ); + assert.hasClasses( range, "ui-slider-range ui-widget-header" ); + assert.hasClasses( handle[ 0 ], "ui-slider-handle" ); + assert.hasClasses( handle[ 1 ], "ui-slider-handle" ); +}); + test( "keydown HOME on handle sets value to min", function() { expect( 2 ); element = $( "<div></div>" ); |