From 4751a0a2745b8480371678281ee6a7f874aaf096 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 27 Aug 2012 21:27:01 -0700 Subject: crude check to make sure element has a # for an id --- js/tests/unit/bootstrap-dropdown.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'js/tests') diff --git a/js/tests/unit/bootstrap-dropdown.js b/js/tests/unit/bootstrap-dropdown.js index 4e52c8485..3a617692b 100644 --- a/js/tests/unit/bootstrap-dropdown.js +++ b/js/tests/unit/bootstrap-dropdown.js @@ -61,6 +61,24 @@ $(function () { ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click') }) + test("should test if element has a # before assuming it's a selector", function () { + var dropdownHTML = '' + , dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click() + + ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click') + }) + + test("should remove open class if body clicked", function () { var dropdownHTML = '