diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-01-19 14:23:08 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-01-19 14:23:08 +0000 |
commit | f9964794bc388bc602f2c92d0e0102b89c0c5bd2 (patch) | |
tree | d3cbd5e64587062c5d6755db51b25f1a0d6690cb /spec/features | |
parent | a2a43d82d641321d1d30bd002ccce437c86e2361 (diff) | |
parent | ac322d38e947f8516bdfa9b66c4692f4c32716c8 (diff) | |
download | gitlab-ce-f9964794bc388bc602f2c92d0e0102b89c0c5bd2.tar.gz |
Merge branch '26803-typing-then-tab-in-a-comment-doesn-t-select-the-author' into 'master'
Fixed highlightFirst and added specs
Closes #26803
See merge request !8622
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/issues/gfm_autocomplete_spec.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index 82c9bd0e6e6..31156fcf994 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -33,6 +33,45 @@ feature 'GFM autocomplete', feature: true, js: true do expect(page).not_to have_selector('.atwho-view') end + it 'doesnt select the first item for non-assignee dropdowns' do + page.within '.timeline-content-form' do + find('#note_note').native.send_keys('') + find('#note_note').native.send_keys(':') + end + + expect(page).to have_selector('.atwho-container') + + wait_for_ajax + + expect(find('#at-view-58')).not_to have_selector('.cur:first-of-type') + end + + it 'selects the first item for assignee dropdowns' do + page.within '.timeline-content-form' do + find('#note_note').native.send_keys('') + find('#note_note').native.send_keys('@') + end + + expect(page).to have_selector('.atwho-container') + + wait_for_ajax + + expect(find('#at-view-64')).to have_selector('.cur:first-of-type') + end + + it 'selects the first item for non-assignee dropdowns if a query is entered' do + page.within '.timeline-content-form' do + find('#note_note').native.send_keys('') + find('#note_note').native.send_keys(':1') + end + + expect(page).to have_selector('.atwho-container') + + wait_for_ajax + + expect(find('#at-view-58')).to have_selector('.cur:first-of-type') + end + context 'if a selected value has special characters' do it 'wraps the result in double quotes' do note = find('#note_note') |