mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
whitespace in core tests
This commit is contained in:
parent
6487eb684f
commit
2cff5c3380
1 changed files with 24 additions and 24 deletions
|
|
@ -34,57 +34,57 @@
|
|||
ok($.mobile.gradeA());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//data tests
|
||||
test( "$.fn.jqmData and $.fn.jqmRemoveData methods are working properly", function(){
|
||||
same( $("body").jqmData("foo", true), $("body"), "setting data returns the element" );
|
||||
|
||||
|
||||
same( $("body").jqmData("foo"), true, "getting data returns the right value" );
|
||||
|
||||
|
||||
same( $("body").data($.mobile.ns + "foo"), true, "data was set using namespace" );
|
||||
|
||||
|
||||
same( $("body").jqmData("foo", undefined), true, "getting data still returns the value if there's an undefined second arg" );
|
||||
|
||||
|
||||
same( $("body").jqmData(), { "nstest-foo": true}, "passing no arguments returns a hash with all set properties" );
|
||||
|
||||
|
||||
same( $("body").jqmData(undefined), { "nstest-foo": true}, "passing a single undefined argument returns a hash with all set properties" );
|
||||
|
||||
|
||||
same( $("body").jqmData(undefined, undefined), {"nstest-foo": true}, "passing 2 undefined arguments returns a hash with all set properties" );
|
||||
|
||||
|
||||
same( $("body").jqmRemoveData("foo"), $("body"), "jqmRemoveData returns the element" );
|
||||
|
||||
|
||||
same( $("body").jqmData("foo"), undefined, "jqmRemoveData properly removes namespaced data" );
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
test( "$.jqmData and $.jqmRemoveData methods are working properly", function(){
|
||||
same( $.jqmData(document.body, "foo", true), true, "setting data returns the value" );
|
||||
|
||||
|
||||
same( $.jqmData(document.body, "foo"), true, "getting data returns the right value" );
|
||||
|
||||
|
||||
same( $.data(document.body, $.mobile.ns + "foo"), true, "data was set using namespace" );
|
||||
|
||||
|
||||
same( $.jqmData(document.body, "foo", undefined), true, "getting data still returns the value if there's an undefined second arg" );
|
||||
|
||||
|
||||
same( $.jqmData(document.body), { "nstest-foo": true}, "passing no arguments returns a hash with all set properties" );
|
||||
|
||||
|
||||
same( $.jqmData(document.body, undefined), { "nstest-foo": true}, "passing a single undefined argument returns a hash with all set properties" );
|
||||
|
||||
|
||||
same( $.jqmData(document.body, undefined, undefined), {"nstest-foo": true}, "passing 2 undefined arguments returns a hash with all set properties" );
|
||||
|
||||
|
||||
same( $.jqmRemoveData(document.body, "foo"), undefined, "jqmRemoveData returns the undefined value" );
|
||||
|
||||
|
||||
same( $("body").jqmData("foo"), undefined, "jqmRemoveData properly removes namespaced data" );
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
test( "jqmHasData method is working properly", function(){
|
||||
same( $.jqmHasData(document.body, "foo"), false, "body has no data defined under 'foo'" );
|
||||
$.jqmData(document.body, "foo", true);
|
||||
same( $.jqmHasData(document.body, "foo"), true, "after setting, body has data defined under 'foo' equal to true" );
|
||||
$.jqmRemoveData(document.body, "foo");
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue