mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user