mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-09 15:14:44 +00:00
updated unit tests to ensure the enhance event is working properly on self-initializing widgets
This commit is contained in:
parent
64e6ef0e72
commit
6f701add58
12 changed files with 90 additions and 2 deletions
|
|
@ -111,8 +111,9 @@
|
|||
});
|
||||
|
||||
test( "checkboxradio controls will create when inside a container that receives an 'enhance' event", function(){
|
||||
ok( $("#fragment").appendTo(".ui-page-active").find(".ui-btn").length );
|
||||
})
|
||||
ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-checkbox").length, "did not have enhancements applied" );
|
||||
ok( $("#enhancetest").trigger("enhance").find(".ui-checkbox").length, "enhancements applied" );
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
|
|
|||
|
|
@ -73,6 +73,16 @@
|
|||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="enhancetest">
|
||||
<input type="checkbox" name="checkbox-332" id="checkbox-332" class="custom"/>
|
||||
<label for="checkbox-332">I agree 3.2</label>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -119,4 +119,11 @@
|
|||
});
|
||||
|
||||
|
||||
test( "controlgroups will create when inside a container that receives an 'enhance' event", function(){
|
||||
ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-controlgroup").length, "did not have enhancements applied" );
|
||||
ok( $("#enhancetest").trigger("enhance").find(".ui-controlgroup").length, "enhancements applied" );
|
||||
});
|
||||
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
|
|
|||
|
|
@ -64,5 +64,17 @@
|
|||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div data-nstest-role="fieldcontain" id="enhancetest">
|
||||
<fieldset data-nstest-role="controlgroup">
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -7,4 +7,10 @@
|
|||
test( "Field container contains appropriate css styles", function(){
|
||||
ok($('#test-fieldcontain').hasClass('ui-field-contain ui-body ui-br'), 'A fieldcontain element must contain styles "ui-field-contain ui-body ui-br"');
|
||||
});
|
||||
|
||||
test( "Field container will create when inside a container that receives an 'enhance' event", function(){
|
||||
ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-field-contain").length, "did not have enhancements applied" );
|
||||
ok( $("#enhancetest").trigger("enhance").find(".ui-field-contain").length, "enhancements applied" );
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
|
|
|||
|
|
@ -38,5 +38,11 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div id="enhancetest">
|
||||
<div data-nstest-role="fieldcontain">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -273,5 +273,15 @@
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="enhancetest">
|
||||
<ul data-nstest-role="listview">
|
||||
<li><a href="#basic-link-results">Home</a></li>
|
||||
<li><a href="#basic-link-results">Back</a></li>
|
||||
<li><a href="#basic-link-results">Return</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -483,6 +483,11 @@
|
|||
}
|
||||
]);
|
||||
});
|
||||
|
||||
test( "Listview will create when inside a container that receives an 'enhance' event", function(){
|
||||
ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-listview").length, "did not have enhancements applied" );
|
||||
ok( $("#enhancetest").trigger("enhance").find(".ui-listview").length, "enhancements applied" );
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -303,5 +303,16 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="enhancetest">
|
||||
<select name="select-enhancetest" id="select-enhancetest">
|
||||
<option value="standard">Standard: 7 day</option>
|
||||
<option value="rush">Rush: 3 days</option>
|
||||
<option value="express">Express: next day</option>
|
||||
<option value="overnight">Overnight</option>
|
||||
</select>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -47,4 +47,10 @@
|
|||
test( "selects marked with data-native-menu=true should sit inside the button", function(){
|
||||
same($("#select-choice-native-container div.ui-btn select").length, 1);
|
||||
});
|
||||
|
||||
test( "select controls will create when inside a container that receives an 'enhance' event", function(){
|
||||
ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-select").length, "did not have enhancements applied" );
|
||||
ok( $("#enhancetest").trigger("enhance").find(".ui-select").length, "enhancements applied" );
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
|
|
|||
|
|
@ -57,5 +57,13 @@
|
|||
<div data-nstest-role="fieldcontain">
|
||||
<input type="range" name="onchange" id="onchange" value="25" min="0" max="100" step="10" onchange="onChangeCounter()" data-nstest-theme="b" data-nstest-track-theme="a" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="enhancetest">
|
||||
<input type="range" name="slider-enhancetest" id="range-slider-enhancetest" value="75" min="0" max="100" data-nstest-theme="b" data-nstest-track-theme="a" />
|
||||
</div>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -155,4 +155,10 @@
|
|||
$( "#onchange" ).slider( "refresh", 50 );
|
||||
equals(onChangeCnt, 1, "onChange should have been called once");
|
||||
});
|
||||
|
||||
|
||||
test( "slider controls will create when inside a container that receives an 'enhance' event", function(){
|
||||
ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-slider").length, "did not have enhancements applied" );
|
||||
ok( $("#enhancetest").trigger("enhance").find(".ui-slider").length, "enhancements applied" );
|
||||
});
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue