Close datepicker in tests after filling in dates
Some tests were failing depending on the window resolution due to the datepicker making it impossible to click the "Filter" button. They were also failing if using `clear: :backspace` to fill in those fields. So we're focusing on a different field in order to hide the datepicker and click the "Filter" button.
This commit is contained in:
@@ -274,6 +274,7 @@ describe "Advanced search", :js do
|
|||||||
select "Customized", from: "js-advanced-search-date-min"
|
select "Customized", from: "js-advanced-search-date-min"
|
||||||
fill_in "advanced_search_date_min", with: 7.days.ago.strftime("%d/%m/%Y")
|
fill_in "advanced_search_date_min", with: 7.days.ago.strftime("%d/%m/%Y")
|
||||||
fill_in "advanced_search_date_max", with: 1.day.ago.strftime("%d/%m/%Y")
|
fill_in "advanced_search_date_max", with: 1.day.ago.strftime("%d/%m/%Y")
|
||||||
|
find_field("With the text").click
|
||||||
click_button "Filter"
|
click_button "Filter"
|
||||||
|
|
||||||
within("#debates") do
|
within("#debates") do
|
||||||
@@ -296,6 +297,7 @@ describe "Advanced search", :js do
|
|||||||
select "Customized", from: "js-advanced-search-date-min"
|
select "Customized", from: "js-advanced-search-date-min"
|
||||||
fill_in "advanced_search_date_min", with: 4000.years.ago.strftime("%d/%m/%Y")
|
fill_in "advanced_search_date_min", with: 4000.years.ago.strftime("%d/%m/%Y")
|
||||||
fill_in "advanced_search_date_max", with: "13/13/2199"
|
fill_in "advanced_search_date_max", with: "13/13/2199"
|
||||||
|
find_field("With the text").click
|
||||||
click_button "Filter"
|
click_button "Filter"
|
||||||
|
|
||||||
expect(page).to have_content("There are 3 citizen proposals")
|
expect(page).to have_content("There are 3 citizen proposals")
|
||||||
@@ -355,6 +357,7 @@ describe "Advanced search", :js do
|
|||||||
select "Customized", from: "js-advanced-search-date-min"
|
select "Customized", from: "js-advanced-search-date-min"
|
||||||
fill_in "advanced_search_date_min", with: 7.days.ago.strftime("%d/%m/%Y")
|
fill_in "advanced_search_date_min", with: 7.days.ago.strftime("%d/%m/%Y")
|
||||||
fill_in "advanced_search_date_max", with: 1.day.ago.strftime("%d/%m/%Y")
|
fill_in "advanced_search_date_max", with: 1.day.ago.strftime("%d/%m/%Y")
|
||||||
|
find_field("With the text").click
|
||||||
click_button "Filter"
|
click_button "Filter"
|
||||||
|
|
||||||
expect(page).to have_content("citizen proposals cannot be found")
|
expect(page).to have_content("citizen proposals cannot be found")
|
||||||
|
|||||||
Reference in New Issue
Block a user