diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-10-07 15:19:26 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-10-07 15:23:42 -0400 |
commit | fcf99d0d09d63d0662290658ebc1e366bfc11bf0 (patch) | |
tree | 11a470e747bf091fd41fff543d3545486806ae29 /spec/javascripts/behaviors | |
parent | f96c6c43c49c8c423f42a99ae27e02d47f04c748 (diff) | |
download | gitlab-ce-fcf99d0d09d63d0662290658ebc1e366bfc11bf0.tar.gz |
Check originalEvent.repeat
Diffstat (limited to 'spec/javascripts/behaviors')
-rw-r--r-- | spec/javascripts/behaviors/quick_submit_spec.js.coffee | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/javascripts/behaviors/quick_submit_spec.js.coffee b/spec/javascripts/behaviors/quick_submit_spec.js.coffee index 6beef28741b..fd20f674746 100644 --- a/spec/javascripts/behaviors/quick_submit_spec.js.coffee +++ b/spec/javascripts/behaviors/quick_submit_spec.js.coffee @@ -23,6 +23,11 @@ describe 'Quick Submit behavior', -> expect(@spies.submit).not.toHaveBeenTriggered() + it 'does not respond to repeated events', -> + $('input').trigger(keydownEvent(repeat: true)) + + expect(@spies.submit).not.toHaveBeenTriggered() + it 'disables submit buttons', -> $('textarea').trigger(keydownEvent()) @@ -62,4 +67,7 @@ describe 'Quick Submit behavior', -> else defaults = { keyCode: 13, ctrlKey: true } - $.Event('keydown', $.extend({}, defaults, options)) + args = $.extend({}, defaults, options) + originalEvent = new KeyboardEvent('keydown', args) + + $.Event('keydown', $.extend({}, args, {originalEvent: originalEvent})) |