DEV: Move calendar date + time picker from local dates into core component (#23023)

This commit moves the calendar date and time picker shown in
the local dates modal into a core component that can be reused
in other places. Also add system specs to make sure there isn't
any breakages with this feature, and a section to the styleguide.
This commit is contained in:
Martin Brennan
2023-08-11 13:05:44 +10:00
committed by GitHub
parent 0187ad0d37
commit fb36af7799
14 changed files with 463 additions and 200 deletions

View File

@ -0,0 +1,26 @@
# frozen_string_literal: true
module PageObjects
module Modals
class InsertDateTime < PageObjects::Modals::Base
MODAL_CSS_CLASS = ".discourse-local-dates-create-modal"
def calendar_date_time_picker
@calendar_date_time_picker ||=
PageObjects::Components::CalendarDateTimePicker.new(MODAL_CSS_CLASS)
end
def select_to
find(".date-time-control.to").click
end
def select_from
find(".date-time-control.from").click
end
def delete_to
find(".delete-to-date").click
end
end
end
end