summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorBrian Hall <brian@hack.design>2017-01-30 22:12:31 -0600
committerBrian Hall <brian@hack.design>2017-01-31 12:28:49 -0600
commit7bf6df8463c4f8871682f385e9368d169b4ffecf (patch)
tree5848818ea63a6f69b19b5d4b5b49433b6229d137 /spec/javascripts
parentb78d06b78143b16dccc5d5afaa8796473b68bea1 (diff)
downloadgitlab-ce-7bf6df8463c4f8871682f385e9368d169b4ffecf.tar.gz
Change the reply shortcut to focus the field even without a selection.
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/shortcuts_issuable_spec.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/javascripts/shortcuts_issuable_spec.js b/spec/javascripts/shortcuts_issuable_spec.js
index 386fc8f514e..db2302c4fb0 100644
--- a/spec/javascripts/shortcuts_issuable_spec.js
+++ b/spec/javascripts/shortcuts_issuable_spec.js
@@ -27,11 +27,19 @@
return this.selector = 'form.js-main-target-form textarea#note_note';
});
describe('with empty selection', function() {
- return it('does nothing', function() {
- stubSelection('');
+ it('does not return an error', function() {
this.shortcut.replyWithSelectedText();
return expect($(this.selector).val()).toBe('');
});
+ return it('triggers `input`', function() {
+ var focused;
+ focused = false;
+ $(this.selector).on('focus', function() {
+ return focused = true;
+ });
+ this.shortcut.replyWithSelectedText();
+ return expect(focused).toBe(true);
+ });
});
describe('with any selection', function() {
beforeEach(function() {