Check whether the changes made by the keyboard are taken into account in datetimepicker

- User can change minute directly with keyboard, and without closing the datetimepicker, the modification should be catch and then a label "You have unsaved changes" with the "Save changes" button should appear
This commit is contained in:
Jean-Baptiste Bellet
2021-06-01 12:04:14 +02:00
parent 0db7df6c14
commit 60f3ebca62

View File

@@ -604,6 +604,16 @@ feature '
end
end
scenario "modify the minute of a order cycle with the keyboard, check that the modifications are taken into account" do
order_cycle = create(:simple_order_cycle, name: "Translusent Berries")
login_as_admin_and_visit admin_order_cycles_path
find("#oc#{order_cycle.id}_orders_close_at").click
datetime = Time.at(Time.zone.local(2040, 10, 17, 0o6, 0o0, 0o0))
input = find(".flatpickr-calendar.open .flatpickr-minute")
input.send_keys datetime.strftime("%M").to_s.strip
expect(page).to have_content "You have unsaved changes"
end
scenario "deleting an order cycle" do
order_cycle = create(:simple_order_cycle, name: "Translusent Berries")
login_as_admin_and_visit admin_order_cycles_path