File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 145145 same ( $ ( "#encoded" ) . getEncodedText ( ) , "foo>" ) ;
146146 same ( $ ( "#unencoded" ) . getEncodedText ( ) , "foo" ) ;
147147 } ) ;
148+
149+ test ( "closestPageData returns the parent's page data" , function ( ) {
150+ var pageChild = $ ( "#page-child" ) ;
151+
152+ $ ( "#parent-page" ) . data ( "page" , { foo : "bar" } ) ;
153+ same ( pageChild . closestPageData ( ) . foo , "bar" ) ;
154+ } ) ;
155+
156+ test ( "closestPageData returns the parent dialog's page data" , function ( ) {
157+ var dialogChild = $ ( "#dialog-child" ) ;
158+
159+ $ ( "#parent-dialog" ) . data ( "page" , { foo : "bar" } ) ;
160+ same ( dialogChild . closestPageData ( ) . foo , "bar" ) ;
161+ } ) ;
148162} ) ( jQuery ) ;
Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ <h2 id="qunit-userAgent"></h2>
3535 < div id ="dependent "> </ div >
3636 < div id ="encoded "> foo></ div >
3737 < div id ="unencoded "> < script > foo </ script > </ div >
38+
39+ < div id ="parent-page " data-nstest-role ="page ">
40+ < div id ="page-child "> </ div >
41+ </ div >
42+
43+ < div id ="parent-dialog " data-nstest-role ="dialog ">
44+ < div id ="dialog-child "> </ div >
45+ </ div >
3846</ div >
3947</ body >
4048</ html >
You can’t perform that action at this time.
0 commit comments