summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/.jshintrc1
-rw-r--r--test/jquery-ui-timepicker-addon_spec.js24
2 files changed, 25 insertions, 0 deletions
diff --git a/test/.jshintrc b/test/.jshintrc
index 744a6f2..391bd7f 100644
--- a/test/.jshintrc
+++ b/test/.jshintrc
@@ -15,6 +15,7 @@
"jQuery",
"$",
"QUnit",
+ "jasmine",
"module",
"test",
"asyncTest",
diff --git a/test/jquery-ui-timepicker-addon_spec.js b/test/jquery-ui-timepicker-addon_spec.js
index 7da1ecf..4600a4f 100644
--- a/test/jquery-ui-timepicker-addon_spec.js
+++ b/test/jquery-ui-timepicker-addon_spec.js
@@ -661,4 +661,28 @@ describe('datetimepicker', function() {
});
});
});
+
+ describe('altField', function() {
+ var $input;
+ var $altField;
+ var inputFocusSpy;
+
+ beforeEach(function() {
+ $input = affix('input');
+ $altField = affix('input');
+
+ inputFocusSpy = jasmine.createSpy();
+ $input.focus(inputFocusSpy);
+ });
+
+ it('should redirect focus to main field', function() {
+ $input.datetimepicker({
+ showOn: 'button',
+ altField: $altField,
+ });
+
+ $altField.trigger('focus');
+ expect(inputFocusSpy).toHaveBeenCalled();
+ });
+ });
});