diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2012-07-23 01:50:52 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2012-07-23 01:50:52 +0400 |
commit | fae6c36874b102408b53c6e5d980b247a9779dea (patch) | |
tree | b9aa63f055d185c9921c8ad6ff16800e2c73f00f /js/tests/unit/bootstrap-typeahead.js | |
parent | 8281a9023a9a687be007de85f1731d131eedaf30 (diff) |
adds minLength #3960
Diffstat (limited to 'js/tests/unit/bootstrap-typeahead.js')
-rw-r--r-- | js/tests/unit/bootstrap-typeahead.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/tests/unit/bootstrap-typeahead.js b/js/tests/unit/bootstrap-typeahead.js index 25d4cafd8e..eb447aaa6e 100644 --- a/js/tests/unit/bootstrap-typeahead.js +++ b/js/tests/unit/bootstrap-typeahead.js @@ -181,4 +181,24 @@ $(function () { typeahead.$menu.remove() }) + + test("should start querying when minLength is met", function () { + var $input = $('<input />').typeahead({ + source: ['aaaa', 'aaab', 'aaac'], + minLength: 3 + }) + , typeahead = $input.data('typeahead') + + $input.val('aa') + typeahead.lookup() + + equals(typeahead.$menu.find('li').length, 0, 'has 0 items in menu') + + $input.val('aaa') + typeahead.lookup() + + equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu') + + typeahead.$menu.remove() + }) }) |