BigW Consortium Gitlab

Commit 07e95212 by Stan Hu

Fix recent_searches_spec.rb by clicking on buttons instead of relying on hidden elements

parent 1899d543
......@@ -80,7 +80,8 @@ describe 'Recent searches', js: true 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)[0].click
find('.filtered-search-history-dropdown-toggle-button').click
all('.filtered-search-history-dropdown-item')[0].click
wait_for_filtered_search('foo')
expect(find('.filtered-search').value.strip).to eq('foo')
......@@ -90,12 +91,14 @@ describe 'Recent searches', js: true do
set_recent_searches(project_1_local_storage_key, '["foo"]')
visit project_issues_path(project_1)
items_before = all('.filtered-search-history-dropdown-item', visible: false)
find('.filtered-search-history-dropdown-toggle-button').click
items_before = all('.filtered-search-history-dropdown-item')
expect(items_before.count).to eq(1)
find('.filtered-search-history-clear-button', visible: false).click
items_after = all('.filtered-search-history-dropdown-item', visible: false)
find('.filtered-search-history-clear-button').click
find('.filtered-search-history-dropdown-toggle-button').click
items_after = all('.filtered-search-history-dropdown-item')
expect(items_after.count).to eq(0)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment