|
128 | 128 | $( '<div data-'+ $.mobile.ns +'role="collapsible"><h3>Collapsible Item ' + i + '</h3></div>' ).appendTo( set );
|
129 | 129 | }
|
130 | 130 | set.collapsibleset( "refresh" );
|
131 |
| - equal( set.find( ".ui-collapsible" ).length, 3, "The 3 collapsible should be enhanced" ); |
| 131 | + equal( set.find( ".ui-collapsible" ).length, 3, "The 3 collapsibles should be enhanced" ); |
132 | 132 | ok( set.find( ".ui-collapsible" ).eq( 0 ).find( "a" ).hasClass( "ui-corner-top" ), "The 1st collapsible should have top corners" );
|
133 | 133 | ok( !set.find( ".ui-collapsible" ).eq( 0 ).find( "a" ).hasClass( "ui-corner-bottom" ), "The 1st collapsible should NOT have bottom corners" );
|
134 | 134 | ok( !set.find( ".ui-collapsible" ).eq( 1 ).find( "a" ).hasClass( "ui-corner-top" ), "The 2nd collapsible should NOT have top corners" );
|
|
140 | 140 | ]);
|
141 | 141 | });
|
142 | 142 |
|
| 143 | + asyncTest( "Collapsible Set with static and dynamic content", function(){ |
| 144 | + $.testHelper.pageSequence([ |
| 145 | + function(){ |
| 146 | + $.testHelper.openPage( "#collapsible-set-with-static-and-dynamic-content" ); |
| 147 | + }, |
| 148 | + |
| 149 | + function() { |
| 150 | + var set = $( ".ui-page-active" ).find( ".ui-collapsible-set" ); |
| 151 | + for ( var i = 0; i < 2; i++ ) { |
| 152 | + $( '<div data-'+ $.mobile.ns +'role="collapsible"><h3>Collapsible Item ' + i + '</h3></div>' ).appendTo( set ); |
| 153 | + } |
| 154 | + set.collapsibleset( "refresh" ); |
| 155 | + equal( set.find( ".ui-collapsible" ).length, 3, "The 3 collapsibles should be enhanced" ); |
| 156 | + ok( set.find( ".ui-collapsible" ).eq( 0 ).find( "a" ).hasClass( "ui-corner-top" ), "The 1st collapsible should have top corners" ); |
| 157 | + ok( !set.find( ".ui-collapsible" ).eq( 0 ).find( "a" ).hasClass( "ui-corner-bottom" ), "The 1st collapsible should NOT have bottom corners" ); |
| 158 | + ok( !set.find( ".ui-collapsible" ).eq( 1 ).find( "a" ).hasClass( "ui-corner-top" ), "The 2nd collapsible should NOT have top corners" ); |
| 159 | + ok( !set.find( ".ui-collapsible" ).eq( 1 ).find( "a" ).hasClass( "ui-corner-bottom" ), "The 2nd collapsible should NOT have bottom corners" ); |
| 160 | + ok( set.find( ".ui-collapsible" ).eq( 2 ).find( "a" ).hasClass( "ui-corner-bottom" ), "The 3rd collapsible should have bottom corners" ); |
| 161 | + ok( !set.find( ".ui-collapsible" ).eq( 2 ).find( "a" ).hasClass( "ui-corner-top" ), "The 3rd collapsible should NOT have top corners" ); |
| 162 | + start(); |
| 163 | + } |
| 164 | + ]); |
| 165 | + }); |
| 166 | + |
143 | 167 | module( "Theming", {});
|
144 | 168 |
|
145 | 169 | asyncTest( "Collapsible", 6, function(){
|
|
0 commit comments