File tree Expand file tree Collapse file tree 2 files changed +29
-5
lines changed
Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 44( function ( $ ) {
55 module ( 'jquery.mobile.fieldContain.js' ) ;
66
7- test ( "Field container contains appropriate css styles" , function ( ) {
7+ test ( "Field container contains appropriate css styles" , function ( ) {
88 ok ( $ ( '#test-fieldcontain' ) . hasClass ( 'ui-field-contain ui-body ui-br' ) , 'A fieldcontain element must contain styles "ui-field-contain ui-body ui-br"' ) ;
99 } ) ;
10-
10+
1111 test ( "Field container will create when inside a container that receives a 'create' event" , function ( ) {
1212 ok ( ! $ ( "#enhancetest" ) . appendTo ( ".ui-page-active" ) . find ( ".ui-field-contain" ) . length , "did not have enhancements applied" ) ;
1313 ok ( $ ( "#enhancetest" ) . trigger ( "create" ) . find ( ".ui-field-contain" ) . length , "enhancements applied" ) ;
1414 } ) ;
15-
15+
16+ test ( "field containers inside ignore container should not be enhanced" , function ( ) {
17+ var $ignored = $ ( "#ignored-fieldcontain" ) , $enhanced = $ ( "#enhanced-fieldcontain" ) ;
18+
19+ $ . mobile . ignoreContentEnabled = true ;
20+
21+ $ ( "#ignore-container-tests" ) . trigger ( "create" ) ;
22+
23+ same ( $ignored . attr ( "class" ) , undefined , "ignored div does not have field contain class" ) ;
24+ ok ( $enhanced . hasClass ( "ui-field-contain" ) , "enhanced div has field contain class" ) ;
25+
26+ $ . mobile . ignoreContentEnabled = false ;
27+
28+ } ) ;
1629} ) ( jQuery ) ;
Original file line number Diff line number Diff line change @@ -46,10 +46,21 @@ <h2 id="qunit-userAgent"></h2>
4646</ div >
4747
4848< div id ="enhancetest ">
49- < div data-nstest-role ="fieldcontain ">
50- </ div >
49+ < div data-nstest-role ="fieldcontain ">
50+ </ div >
5151</ div >
5252
53+ < div id ="ignore-container-tests ">
54+ < div data-nstest-enhance ="false ">
55+ < div data-nstest-role ="fieldcontain " id ="ignored-fieldcontain ">
56+ </ div >
57+ </ div >
58+
59+ < div >
60+ < div data-nstest-role ="fieldcontain " id ="enhanced-fieldcontain ">
61+ </ div >
62+ </ div >
63+ </ div >
5364
5465</ body >
5566</ html >
You can’t perform that action at this time.
0 commit comments