mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-19 07:20:24 +00:00
32 lines
916 B
JavaScript
32 lines
916 B
JavaScript
/*
|
|
* mobile widget unit tests
|
|
*/
|
|
|
|
module('jquery.mobile.widget.js');
|
|
|
|
test( "getting data from creation options", function(){
|
|
var expected = "bizzle";
|
|
|
|
$.mobile.widget.prototype.options = { "fooBar" : true };
|
|
$.mobile.widget.prototype.element = $("<div data-foo-bar=" + expected + ">");
|
|
same($.mobile.widget.prototype._getCreateOptions()["fooBar"],
|
|
expected);
|
|
});
|
|
|
|
test( "getting no data when the options are empty", function(){
|
|
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(){
|
|
var expected = {};
|
|
|
|
$.mobile.widget.prototype.options = { "fooBar" : true };
|
|
$.mobile.widget.prototype.element = $("<div>");
|
|
same($.mobile.widget.prototype._getCreateOptions(),
|
|
expected);
|
|
});
|