Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[unit tests] Moving references to widget instances to the new namespa…

…ced key
  • Loading branch information...
commit 64488f757498ddb607a322f942ef5c8fd47cea60 1 parent 8cecf0d
@gabrielschulhof gabrielschulhof authored
View
6 tests/unit/core/core.js
@@ -162,14 +162,14 @@
test( "closestPageData returns the parent's page data", function() {
var pageChild = $( "#page-child" );
- $( "#parent-page" ).data( "page", { foo: "bar" } );
+ $( "#parent-page" ).data( "mobile-page", { foo: "bar" } );
deepEqual( $.mobile.closestPageData( pageChild ).foo, "bar" );
});
test( "closestPageData returns the parent dialog's page data", function() {
var dialogChild = $( "#dialog-child" );
- $( "#parent-dialog" ).data( "page", { foo: "bar" } );
+ $( "#parent-dialog" ).data( "mobile-page", { foo: "bar" } );
deepEqual( $.mobile.closestPageData(dialogChild).foo, "bar" );
});
@@ -187,4 +187,4 @@
$.mobile.ignoreContentEnabled = false;
});
-})(jQuery);
+})(jQuery);
View
14 tests/unit/popup/popup_core.js
@@ -15,7 +15,7 @@
function popupEnhancementTests( $sel, prefix ) {
var $container = $sel.parent(), $screen = $sel.parent().prev();
- ok( $sel.data( "popup" ), prefix + ", popup div is associated with a popup widget" );
+ ok( $sel.data( "mobile-popup" ), prefix + ", popup div is associated with a popup widget" );
ok( $sel.hasClass( "ui-popup" ), prefix + ", popup payload has class 'ui-popup'" );
ok( $container.hasClass( "ui-popup-container" ), prefix + ", popup div parent has class ui-popup-container" );
ok( $container.parent().hasClass( "ui-page" ), prefix + ", popup container parent is the page" );
@@ -31,7 +31,7 @@
test( "Popup tolerances are parsed correctly", function() {
var tolTestElement = $( "#tolerance-test" ),
- tolTestPopup = tolTestElement.data( "popup" ),
+ tolTestPopup = tolTestElement.data( "mobile-popup" ),
defaultValues = tolTestPopup._tolerance;
ok( (
@@ -185,7 +185,7 @@
asyncTest( "Popup interacts correctly with hashchange", function() {
var baseUrl, activeIndex, $popup = $( "#test-popup" );
- if( !$popup.data( "popup" ).options.history ) {
+ if( !$popup.data( "mobile-popup" ).options.history ) {
expect( 1 )
ok( true, "hash change disabled" );
start();
@@ -237,7 +237,7 @@
initialBase = initialHRef.protocol + initialHRef.doubleSlash + initialHRef.authority + initialHRef.directory,
$popup = $( "#test-popup" );
- if( !$popup.data( "popup" ).options.history ) {
+ if( !$popup.data( "mobile-popup" ).options.history ) {
expect( 1 )
ok( true, "hash change disabled" );
start();
@@ -415,7 +415,7 @@
expect( 3 );
- ok( !$popup.data( "popup" )._isOpen, "popup is initially closed" );
+ ok( !$popup.data( "mobile-popup" )._isOpen, "popup is initially closed" );
$.testHelper.detailedEventCascade([
function() {
@@ -427,7 +427,7 @@
},
function() {
- ok( $popup.data( "popup" )._isOpen, "popup is opened with open method" );
+ ok( $popup.data( "mobile-popup" )._isOpen, "popup is opened with open method" );
$popup.find( "a" ).click();
},
@@ -436,7 +436,7 @@
},
function() {
- ok( !$popup.data( "popup" )._isOpen, "popup is closed on link click" );
+ ok( !$popup.data( "mobile-popup" )._isOpen, "popup is closed on link click" );
},
{ timeout: { length: 500 } },
View
6 tests/unit/select/select_cached.js
@@ -114,13 +114,13 @@
deepEqual( $(":jqmData(role='dialog')").length, dialogCount);
// manually trigger dialog opening
- $( "#domcache-uncached-page-select" ).data( 'selectmenu' ).open();
+ $( "#domcache-uncached-page-select" ).data( 'mobile-selectmenu' ).open();
},
function(){
// check if dialog was successfully created
deepEqual( $(":jqmData(role='dialog')").length, dialogCount + 1 );
- $( "#domcache-uncached-page-select" ).data( 'selectmenu' ).close();
+ $( "#domcache-uncached-page-select" ).data( 'mobile-selectmenu' ).close();
},
function(){
@@ -134,4 +134,4 @@
}
]);
});
-})(jQuery);
+})(jQuery);
View
2  tests/unit/select/select_core.js
@@ -336,7 +336,7 @@
// issue #2547
test( "custom select list item links have encoded option text values", function() {
- $( "#encoded-option" ).data( 'selectmenu' )._buildList();
+ $( "#encoded-option" ).data( 'mobile-selectmenu' )._buildList();
deepEqual(window.encodedValueIsDefined, undefined);
});
View
12 tests/unit/slider/slider_events.js
@@ -177,7 +177,7 @@
test( "toggle switch should fire one change event when clicked", function(){
var control = $( "#slider-switch" ),
- widget = control.data( "slider" ),
+ widget = control.data( "mobile-slider" ),
slider = widget.slider,
handle = widget.handle,
changeCount = 0,
@@ -226,7 +226,7 @@
asyncTest( "toggle switch handle should snap in the old position if dragged less than half of the slider width, in the new position if dragged more than half of the slider width", function() {
var control = $( "#slider-switch" ),
- widget = control.data( "slider" ),
+ widget = control.data( "mobile-slider" ),
slider = widget.slider,
handle = widget.handle,
width = handle.width(),
@@ -291,7 +291,7 @@
asyncTest( "toggle switch handle should not move if user is dragging and value is changed", function() {
var control = $( "#slider-switch" ),
- widget = control.data( "slider" ),
+ widget = control.data( "mobile-slider" ),
slider = widget.slider,
handle = widget.handle,
width = handle.width(),
@@ -339,7 +339,7 @@
asyncTest( "toggle switch should refresh when disabled", function() {
var control = $( "#slider-switch" ),
- handle = control.data( "slider" ).handle;
+ handle = control.data( "mobile-slider" ).handle;
$.testHelper.sequence([
function() {
@@ -376,7 +376,7 @@
asyncTest( "moving the slider triggers 'slidestart' and 'slidestop' events", function() {
var control = $( "#start-stop-events" ),
- widget = control.data( "slider" ),
+ widget = control.data( "mobile-slider" ),
slider = widget.slider;
$.testHelper.eventCascade([
@@ -421,4 +421,4 @@
equal(getDocumentEventsLength( "vmousemove" ), (vmousemoveLength - 1), 'vmousemove event was removed');
});
}
-})(jQuery);
+})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.