don't attempt to click on hidden elements

This commit is contained in:
Mike Greiling 2017-11-03 11:25:28 -05:00
parent 43b5bf26c0
commit ae76937bc6
No known key found for this signature in database
GPG Key ID: 0303DF507FA67596
1 changed files with 6 additions and 4 deletions

View File

@ -76,7 +76,8 @@ describe 'Recent searches', :js do
set_recent_searches(project_1_local_storage_key, '["foo", "bar"]')
visit project_issues_path(project_1)
all('.filtered-search-history-dropdown-item', visible: false, count: 2)[0].click
find('.filtered-search-history-dropdown-toggle-button').click
all('.filtered-search-history-dropdown-item', count: 2)[0].click
wait_for_filtered_search('foo')
expect(find('.filtered-search').value.strip).to eq('foo')
@ -86,10 +87,11 @@ describe 'Recent searches', :js do
set_recent_searches(project_1_local_storage_key, '["foo"]')
visit project_issues_path(project_1)
all('.filtered-search-history-dropdown-item', visible: false, count: 1)
find('.filtered-search-history-dropdown-toggle-button').click
all('.filtered-search-history-dropdown-item', count: 1)
find('.filtered-search-history-clear-button', visible: false).click
items_after = all('.filtered-search-history-dropdown-item', visible: false, count: 0)
find('.filtered-search-history-clear-button').click
items_after = all('.filtered-search-history-dropdown-item', count: 0)
expect(items_after.count).to eq(0)
end