From 0dece7a71f4f3591c7d1fecb9dea7cba82c9624a Mon Sep 17 00:00:00 2001 From: Marcel Korpel Date: Sat, 1 Dec 2012 15:19:41 +0100 Subject: Set focus back to input field after clicking an item Test 'focus is still set' added Fixes issue #5933 --- js/tests/unit/bootstrap-typeahead.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'js/tests') diff --git a/js/tests/unit/bootstrap-typeahead.js b/js/tests/unit/bootstrap-typeahead.js index 16bdb9194..5e1183609 100644 --- a/js/tests/unit/bootstrap-typeahead.js +++ b/js/tests/unit/bootstrap-typeahead.js @@ -162,17 +162,22 @@ $(function () { }) , typeahead = $input.data('typeahead') , changed = false + , focus = false + , blur = false $input.val('a') typeahead.lookup() $input.change(function() { changed = true }); + $input.focus(function() { focus = true; blur = false }); + $input.blur(function() { blur = true; focus = false }); $(typeahead.$menu.find('li')[2]).mouseover().click() equals($input.val(), 'ac', 'input value was correctly set') ok(!typeahead.$menu.is(':visible'), 'the menu was hidden') ok(changed, 'a change event was fired') + ok(focus && !blur, 'focus is still set') typeahead.$menu.remove() }) -- cgit v1.2.3 From 82a758344d108721091d628e3a650931b29e2058 Mon Sep 17 00:00:00 2001 From: fat Date: Fri, 21 Dec 2012 17:31:54 -0800 Subject: add direction prop to carousel slide event --- js/tests/unit/bootstrap-carousel.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'js/tests') diff --git a/js/tests/unit/bootstrap-carousel.js b/js/tests/unit/bootstrap-carousel.js index 13b8f721f..80b6e139b 100644 --- a/js/tests/unit/bootstrap-carousel.js +++ b/js/tests/unit/bootstrap-carousel.js @@ -31,6 +31,18 @@ $(function () { .carousel('next') }) + test("should fire slide event with direction", function () { + var template = '' + $.support.transition = false + stop() + $(template).on('slide', function (e) { + e.preventDefault() + ok(e.direction) + ok(e.direction === 'right' || e.direction === 'left') + start() + }).carousel('next') + }) + test("should fire slide event with relatedTarget", function () { var template = '' $.support.transition = false -- cgit v1.2.3