aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2012-03-23 18:29:21 -0700
committerMark Otto <[email protected]>2012-03-23 18:29:21 -0700
commitf87e4c60e9bb33f29bffed702af797b322821b8f (patch)
tree64c0663ec3ef31ea3fedd9af6ed10826d10bcbc4 /js/tests
parenta57554222f091ed3905259b32d1f1a3786e37200 (diff)
parentb3bf223617754e658eb62ef0f068732e719a2c82 (diff)
downloadbootstrap-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')
-rw-r--r--js/tests/index.html2
-rw-r--r--js/tests/unit/bootstrap-typeahead.js16
2 files changed, 17 insertions, 1 deletions
diff --git a/js/tests/index.html b/js/tests/index.html
index 8c710de36..2d59ab032 100644
--- a/js/tests/index.html
+++ b/js/tests/index.html
@@ -36,7 +36,7 @@
<script src="unit/bootstrap-tooltip.js"></script>
<script src="unit/bootstrap-popover.js"></script>
<script src="unit/bootstrap-typeahead.js"></script>
-
+</head>
<body>
<div>
<h1 id="qunit-header">Bootstrap Plugin Test Suite</h1>
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({