diff options
| author | Mark Otto <[email protected]> | 2012-03-23 18:29:21 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2012-03-23 18:29:21 -0700 |
| commit | f87e4c60e9bb33f29bffed702af797b322821b8f (patch) | |
| tree | 64c0663ec3ef31ea3fedd9af6ed10826d10bcbc4 /js/tests/unit | |
| parent | a57554222f091ed3905259b32d1f1a3786e37200 (diff) | |
| parent | b3bf223617754e658eb62ef0f068732e719a2c82 (diff) | |
| download | bootstrap-f87e4c60e9bb33f29bffed702af797b322821b8f.tar.xz bootstrap-f87e4c60e9bb33f29bffed702af797b322821b8f.zip | |
Merge branch '2.1.0-wip' into 2.0.3-wip
Conflicts:
docs/assets/bootstrap.zip
Diffstat (limited to 'js/tests/unit')
| -rw-r--r-- | js/tests/unit/bootstrap-typeahead.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/js/tests/unit/bootstrap-typeahead.js b/js/tests/unit/bootstrap-typeahead.js index 96ea7c45f..25d313c85 100644 --- a/js/tests/unit/bootstrap-typeahead.js +++ b/js/tests/unit/bootstrap-typeahead.js @@ -52,6 +52,22 @@ $(function () { typeahead.$menu.remove() }) + test("should not explode when regex chars are entered", function () { + var $input = $('<input />').typeahead({ + source: ['aa', 'ab', 'ac', 'mdo*', 'fat+'] + }) + , typeahead = $input.data('typeahead') + + $input.val('+') + typeahead.lookup() + + ok(typeahead.$menu.is(":visible"), 'typeahead is visible') + equals(typeahead.$menu.find('li').length, 1, 'has 1 item in menu') + equals(typeahead.$menu.find('.active').length, 1, 'one item is active') + + typeahead.$menu.remove() + }) + test("should hide menu when query entered", function () { stop() var $input = $('<input />').typeahead({ |
