Skip to content
Browse files

Test applying chosen to a simple, single select.

  • Loading branch information...
1 parent 523c838 commit 1a9864322b16f8a03aa9ba0e7bcec14c096268bc @pfiller pfiller committed
Showing with 12 additions and 0 deletions.
  1. +5 −0 test/chosen.html
  2. +7 −0 test/chosen_test.js
View
5 test/chosen.html
@@ -24,5 +24,10 @@ <h2 id="qunit-userAgent"></h2>
<span>normal test markup</span>
<span>awesome test markup</span>
</div>
+ <div id="qunit-fixture">
+ <select class="chosen" id="test1">
+ <option>Blah</option>
+ </select>
+ </div>
</body>
</html>
View
7 test/chosen_test.js
@@ -30,5 +30,12 @@
test('Chosen is on the jQuery prototype object', 1, function() {
ok($.prototype.chosen, "The chosen function is truthy");
});
+
+ test('Apply Chosen', 3, function() {
+ $("#test1").chosen();
+ ok($("#test1_chzn").length, "Chosen has been applied to a select");
+ equal($("#test1_chzn .chzn-results li").length, $("#test1 option").length, "Number of options matches.")
+ ok($("#test1_chzn .chzn-drop").attr("style").match(/-9000/).length, "Dropdown is off screen")
+ });
}(jQuery));

0 comments on commit 1a98643

Please sign in to comment.
Something went wrong with that request. Please try again.