diff options
author | Phil Hughes <me@iamphill.com> | 2016-07-21 14:41:27 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-07-21 14:41:27 +0100 |
commit | 45fa7fd4ddf35314602168cd869ee4a67c44250b (patch) | |
tree | 2fb75b41170f86ac5ec07fdbb7998c5dcbaf3e27 /spec/features | |
parent | 94e0ca004959196d0c8481f8f8eb28084ae021ae (diff) | |
download | gitlab-ce-45fa7fd4ddf35314602168cd869ee4a67c44250b.tar.gz |
Correctly checks for character before GFM input char
It must not be letter or number to work
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/issues/gfm_autocomplete_spec.rb | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index 000b190de77..7e602672d30 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -9,16 +9,34 @@ feature 'GFM autocomplete', feature: true, js: true do project.team << [user, :master] login_as(user) visit namespace_project_issue_path(project.namespace, project, issue) - end - it 'opens autocomplete menu when doesnt starts with space' do sleep 2 + end + it 'opens autocomplete menu when field starts with text' do page.within '.timeline-content-form' do - find('#note_note').native.send_keys('testing') + find('#note_note').native.send_keys('') find('#note_note').native.send_keys('@') end expect(page).to have_selector('.atwho-view') end + + it 'opens autocomplete menu when field is prefixed with non-text character' 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-view') + end + + it 'doesnt open autocomplete menu character is prefixed with text' do + page.within '.timeline-content-form' do + find('#note_note').native.send_keys('testing') + find('#note_note').native.send_keys('@') + end + + expect(page).not_to have_selector('.atwho-view') + end end |