mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-02 05:50:23 +00:00
test core helpers
This commit is contained in:
parent
76eb594cd1
commit
890c96146e
2 changed files with 16 additions and 0 deletions
|
|
@ -105,4 +105,16 @@
|
|||
|
||||
});
|
||||
|
||||
test( "addDependents works properly", function() {
|
||||
same( $("#parent").jqmData('dependents'), undefined );
|
||||
$( "#parent" ).addDependent( $("#dependent") );
|
||||
same( $("#parent").jqmData('dependents').length, 1 );
|
||||
});
|
||||
|
||||
test( "removeWithDependents removes the parent element and ", function(){
|
||||
$( "#parent" ).addDependent( $("#dependent") );
|
||||
same($( "#parent, #dependent" ).length, 2);
|
||||
$( "#parent" ).removeWithDependents();
|
||||
same($( "#parent, #dependent" ).length, 0);
|
||||
});
|
||||
})(jQuery);
|
||||
|
|
@ -28,5 +28,9 @@
|
|||
<div data-nstest-role="page">
|
||||
</div>
|
||||
|
||||
<div id="qunit-fixtures">
|
||||
<div id="parent"></div>
|
||||
<div id="dependent"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in a new issue