@@ -13,10 +13,12 @@ test( "_find() can handle weird data-url attributes", function() {
13
13
} ) ;
14
14
15
15
( function ( ) {
16
- var originalLoad = $ . mobile . pagecontainer . prototype . _triggerWithDeprecated
16
+ var triggerData ,
17
+ originalLoad = $ . mobile . pagecontainer . prototype . _triggerWithDeprecated ;
17
18
module ( "load method" , {
18
19
setup : function ( ) {
19
- $ . mobile . pagecontainer . prototype . _triggerWithDeprecated = function ( ) {
20
+ $ . mobile . pagecontainer . prototype . _triggerWithDeprecated = function ( eventName , data ) {
21
+ triggerData = data ;
20
22
return {
21
23
deprecatedEvent : {
22
24
isDefaultPrevented : function ( ) {
@@ -30,6 +32,7 @@ module( "load method", {
30
32
}
31
33
} ,
32
34
teardown : function ( ) {
35
+ triggerData = null ;
33
36
$ . mobile . pagecontainer . prototype . _triggerWithDeprecated = originalLoad ;
34
37
}
35
38
} ) ;
@@ -40,6 +43,26 @@ test( "load does not trigger an error when called withput a second param", funct
40
43
ok ( "no error triggered when load method called without options" ) ;
41
44
} ) ;
42
45
46
+ test ( "Options 'reload' and 'reloadPage' both work, and 'reload' takes precedence" , function ( ) {
47
+ var pagecontainer = $ ( ":mobile-pagecontainer" ) ;
48
+
49
+ pagecontainer . pagecontainer ( "load" , "stuff.html" , {
50
+ reload : true ,
51
+ reloadPage : false
52
+ } ) ;
53
+
54
+ deepEqual ( triggerData . options . reload , true ,
55
+ "The value of option 'reload' is not affected by the value of option 'reloadPage'" ) ;
56
+
57
+ pagecontainer . pagecontainer ( "load" , "stuff.html" , {
58
+ reloadPage : true
59
+ } ) ;
60
+
61
+ deepEqual ( triggerData . options . reload , true ,
62
+ "The value of option 'reloadPage' is copied to the value of option 'reload' if the " +
63
+ "latter is absent from the options hash" ) ;
64
+ } ) ;
65
+
43
66
module ( "_handleDialog()" ) ;
44
67
45
68
test ( "A dialog is recognized via presence of the data key, not the ui-dialog class" , function ( ) {
0 commit comments