mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-04 04:44:42 +00:00
added two more negative case tests
This commit is contained in:
parent
04a29ba83b
commit
3834f56d35
1 changed files with 25 additions and 3 deletions
|
|
@ -5,12 +5,34 @@
|
|||
(function( $ ) {
|
||||
test( "getting data attributes from creation options", function(){
|
||||
expect( 1 );
|
||||
var result, expected = "bizzle";
|
||||
var expected = "bizzle";
|
||||
|
||||
$.mobile.widget.prototype.options = { "fooBar" : true };
|
||||
$.mobile.widget.prototype.element = $("<div data-foo-bar=" + expected + ">");
|
||||
|
||||
result = $.mobile.widget.prototype._getCreateOptions();
|
||||
same(result["fooBar"], expected);
|
||||
|
||||
same($.mobile.widget.prototype._getCreateOptions()["fooBar"],
|
||||
expected);
|
||||
});
|
||||
|
||||
test( "getting an no data when the options are empty", function(){
|
||||
expect( 1 );
|
||||
var expected = {};
|
||||
|
||||
$.mobile.widget.prototype.options = {};
|
||||
$.mobile.widget.prototype.element = $("<div data-foo-bar=" + expected + ">");
|
||||
same($.mobile.widget.prototype._getCreateOptions(),
|
||||
expected);
|
||||
});
|
||||
|
||||
test( "getting no data when the element has none", function(){
|
||||
expect( 1 );
|
||||
var expected = {};
|
||||
|
||||
$.mobile.widget.prototype.options = { "fooBar" : true };
|
||||
$.mobile.widget.prototype.element = $("<div>");
|
||||
same($.mobile.widget.prototype._getCreateOptions(),
|
||||
expected);
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue