Commit d78c667d authored by Stan Hu's avatar Stan Hu

Fix broken Spinach tests caused by changes in !6550

Partial fix to #23378
parent a453dace
...@@ -42,15 +42,16 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps ...@@ -42,15 +42,16 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end end
step 'I fill compare fields with branches' do step 'I fill compare fields with branches' do
fill_in 'from', with: 'feature' select_using_dropdown('from', 'feature')
fill_in 'to', with: 'master' select_using_dropdown('to', 'master')
click_button 'Compare' click_button 'Compare'
end end
step 'I fill compare fields with refs' do step 'I fill compare fields with refs' do
fill_in "from", with: sample_commit.parent_id select_using_dropdown('from', sample_commit.parent_id)
fill_in "to", with: sample_commit.id select_using_dropdown('to', sample_commit.id)
click_button "Compare" click_button "Compare"
end end
...@@ -97,8 +98,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps ...@@ -97,8 +98,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end end
step 'I fill compare fields with branches' do step 'I fill compare fields with branches' do
fill_in 'from', with: 'master' select_using_dropdown('from', 'master')
fill_in 'to', with: 'feature' select_using_dropdown('to', 'feature')
click_button 'Compare' click_button 'Compare'
end end
...@@ -182,4 +183,11 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps ...@@ -182,4 +183,11 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
expect(page).to have_content "More submodules" expect(page).to have_content "More submodules"
expect(page).not_to have_content "Change some files" expect(page).not_to have_content "Change some files"
end end
def select_using_dropdown(dropdown_type, selection)
dropdown = find(".js-compare-#{dropdown_type}-dropdown")
dropdown.find(".compare-dropdown-toggle").click
dropdown.fill_in("Filter by branch/tag", with: selection)
find_link(selection, visible: true).click
end
end end
...@@ -45,6 +45,6 @@ describe "Compare", js: true do ...@@ -45,6 +45,6 @@ describe "Compare", js: true do
dropdown = find(".js-compare-#{dropdown_type}-dropdown") dropdown = find(".js-compare-#{dropdown_type}-dropdown")
dropdown.find(".compare-dropdown-toggle").click dropdown.find(".compare-dropdown-toggle").click
dropdown.fill_in("Filter by branch/tag", with: selection) dropdown.fill_in("Filter by branch/tag", with: selection)
click_link selection find_link(selection, visible: true).click
end end
end 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