diff --git a/tests/unit/navbar/index.html b/tests/unit/navbar/index.html new file mode 100644 index 00000000000..bb01067f034 --- /dev/null +++ b/tests/unit/navbar/index.html @@ -0,0 +1,33 @@ + + + + + + jQuery Mobile Navigation Test Suite + + + + + + + + + + + +

jQuery Mobile Navigation Test Suite

+

+

+
    +
+ +
+
+ +
+
+ + diff --git a/tests/unit/navbar/navbar_core.js b/tests/unit/navbar/navbar_core.js new file mode 100644 index 00000000000..501be368b84 --- /dev/null +++ b/tests/unit/navbar/navbar_core.js @@ -0,0 +1,18 @@ +/* + * mobile navbar unit tests + */ +(function($){ + test( "navbar button gets active button class when clicked", function() { + var link = $("#disabled-btn-click a:not(.ui-disabled)").first(); + + link.click(); + ok( link.hasClass($.mobile.activeBtnClass), "link has active button class" ); + }); + + test( "disabled navbar button doesn't add active button class when clicked", function() { + var link = $("#disabled-btn-click a.ui-disabled").first(); + + link.click(); + ok( !link.hasClass($.mobile.activeBtnClass), "link doesn't have active button class" ); + }); +})(jQuery); \ No newline at end of file