1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-18 19:31:35 +02:00

adds minLength #3960

This commit is contained in:
Jacob Thornton
2012-07-22 14:50:52 -07:00
parent 8281a9023a
commit fae6c36874
7 changed files with 42 additions and 7 deletions

View File

@@ -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()
})
})