aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/bootstrap-typeahead.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/js/tests/unit/bootstrap-typeahead.js b/js/tests/unit/bootstrap-typeahead.js
index 16bdb9194..b796a33b3 100644
--- a/js/tests/unit/bootstrap-typeahead.js
+++ b/js/tests/unit/bootstrap-typeahead.js
@@ -137,10 +137,19 @@ $(function () {
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
+ // simulate entire key pressing event
$input.trigger({
type: 'keydown'
, keyCode: 40
})
+ .trigger({
+ type: 'keypress'
+ , keyCode: 40
+ })
+ .trigger({
+ type: 'keyup'
+ , keyCode: 40
+ })
ok(typeahead.$menu.find('li').first().next().hasClass('active'), "second item is active")
@@ -149,6 +158,14 @@ $(function () {
type: 'keydown'
, keyCode: 38
})
+ .trigger({
+ type: 'keypress'
+ , keyCode: 38
+ })
+ .trigger({
+ type: 'keyup'
+ , keyCode: 38
+ })
ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
@@ -196,4 +213,4 @@ $(function () {
typeahead.$menu.remove()
})
-}) \ No newline at end of file
+})