Skip to content
Browse files

Reload the 3 files that make the events module when doing a reload

  • Loading branch information...
1 parent ad09822 commit c5568cbbc4f9568b3e99424c5b20f8ab887bc2a9 @gseguin committed
Showing with 13 additions and 9 deletions.
  1. +9 −8 tests/unit/event/event_core.js
  2. +4 −1 tests/unit/event/index.html
View
17 tests/unit/event/event_core.js
@@ -3,12 +3,13 @@
*/
(function($){
- var libName = "jquery.mobile.event.js",
+ var libName = "jquery.mobile.events.js",
+ components = [ "jquery.mobile.events.touch.js", "jquery.mobile.events.throttledresize.js", "jquery.mobile.events.orientationchange.js" ],
absFn = Math.abs,
originalEventFn = $.Event.prototype.originalEvent,
preventDefaultFn = $.Event.prototype.preventDefault,
- events = ("touchstart touchmove touchend orientationchange tap taphold " +
- "swipe swipeleft swiperight scrollstart scrollstop").split( " " );
+ events = ("touchstart touchmove touchend tap taphold " +
+ "swipe swipeleft swiperight scrollstart scrollstop orientationchange").split( " " );
module(libName, {
setup: function(){
@@ -38,10 +39,10 @@
same($.fn[name], undefined);
});
- $.testHelper.reloadLib(libName);
+ $.each( components, function( index, value ) { $.testHelper.reloadLib( value ); });
$.each(events, function( i, name ) {
- ok($.fn[name] !== undefined, name + " is not undefined");
+ ok( $.fn[name] !== undefined, name + " should NOT be undefined");
});
});
});
@@ -76,7 +77,7 @@
test( "scrollstart enabled defaults to true", function(){
$.event.special.scrollstart.enabled = false;
- $.testHelper.reloadLib(libName);
+ $.each( components, function( index, value ) { $.testHelper.reloadLib( value ); });
ok($.event.special.scrollstart.enabled, "scrollstart enabled");
});
@@ -126,8 +127,8 @@
});
var forceTouchSupport = function(){
- $.support.touch = true;
- $.testHelper.reloadLib(libName);
+ document.ontouchend = true;
+ $.each( components, function( index, value ) { $.testHelper.reloadLib( value ); });
//mock originalEvent information
$.Event.prototype.originalEvent = {
View
5 tests/unit/event/index.html
@@ -13,7 +13,10 @@
</script>
<script src="../../../js/jquery.mobile.define.js"></script>
- <script src="../../../js/jquery.mobile.event.js"></script>
+ <script src="../../../js/jquery.mobile.events.js"></script>
+ <script src="../../../js/jquery.mobile.events.touch.js"></script>
+ <script src="../../../js/jquery.mobile.events.throttledresize.js"></script>
+ <script src="../../../js/jquery.mobile.events.orientationchange.js"></script>
<script src="../../../js/"></script>

0 comments on commit c5568cb

Please sign in to comment.
Something went wrong with that request. Please try again.