Fix flatpickr system spec

On `/admin/orders`, we now have a date range picker.
This spec seems to test only the behavior of flatpickr, which is an external dependencies ; we probably shouldn't test it since it's not our responsibilities. Leave the spec as it for now.
This commit is contained in:
Jean-Baptiste Bellet
2022-11-04 15:29:36 +01:00
parent 9ef07cb110
commit 9464f49031

View File

@@ -9,7 +9,7 @@ describe "Test Flatpickr" do
context "orders" do
it "opens the datepicker and closes it using the 'CLOSE' button" do
login_as_admin_and_visit 'admin/orders'
open_datepicker('#q_completed_at_gteq')
open_datepicker('.datepicker')
# Looks for the close button and click it
within(".flatpickr-calendar.open") do
expect(page).to have_selector '.shortcut-buttons-flatpickr-buttons'
@@ -19,16 +19,9 @@ describe "Test Flatpickr" do
expect(page).not_to have_selector '.flatpickr-calendar.open'
end
it "opens the datepicker and sets date to today" do
login_as_admin_and_visit 'admin/orders'
open_datepicker('#q_completed_at_gteq')
choose_today_from_datepicker
check_fielddate('#q_completed_at_gteq', Date.today())
end
it "opens the datepicker and closes it by clicking outside" do
login_as_admin_and_visit 'admin/orders'
open_datepicker('#q_completed_at_gteq')
open_datepicker('.datepicker')
find("#admin-menu").click
# Should no more have opened flatpickr
expect(page).not_to have_selector '.flatpickr-calendar.open'