slider enhanceWith tests

This commit is contained in:
John Bender 2011-10-10 14:08:19 -07:00
parent 404010839d
commit ec2c015136
2 changed files with 16 additions and 3 deletions

View file

@ -16,6 +16,7 @@
<script src="../../../external/qunit.js"></script>
<script src="slider_events.js"></script>
<script src="slider_core.js"></script>
<script src="../swarminject.js"></script>
</head>
@ -60,9 +61,10 @@
<input type="range" name="onchange" id="onchange" value="25" min="0" max="100" step="10" onchange="onChangeCounter()" data-nstest-theme="b" data-nstest-track-theme="a" />
</div>
<div data-role="fieldcontain">
<label for="slider">Input slider:</label>
<input type="range" name="slider" id="slider" value="25" min="0" max="100" class="should-be-native"/>
</div>
</div>
<div id="enhancetest">

View file

@ -0,0 +1,11 @@
/*
* mobile slider unit tests
*/
(function($){
$.mobile.page.prototype.options.keepNative = "input.should-be-native";
// not testing the positive case here since's it's obviously tested elsewhere
test( "slider elements in the keepNative set shouldn't be enhanced", function() {
same( $("input.should-be-native").siblings("div.ui-slider").length, 0 );
});
})( jQuery );