discourse/spec/system/page_objects/modals/flag.rb
Krzysztof Kotlarek 300ef67481
UX: move admin flag form to form-kit (#28187)
Rewrite the admin flag form to use FormKit. This is a draft because waiting for Checkbox improvements.
2024-08-05 11:01:25 +10:00

38 lines
866 B
Ruby

# frozen_string_literal: true
module PageObjects
module Modals
class Flag < PageObjects::Modals::Base
BODY_SELECTOR = ".flag-modal-body"
MODAL_SELECTOR = ".flag-modal"
def choose_type(type)
body.find("#radio_#{type}").click
end
def confirm_flag
click_primary_button
end
def take_action(action)
select_kit =
PageObjects::Components::SelectKit.new(".d-modal__footer .reviewable-action-dropdown")
select_kit.expand
select_kit.select_row_by_value(action)
end
def fill_message(message)
body.fill_in("message", with: message)
end
def check_confirmation
body.check("confirmation")
end
def has_choices?(*choices)
body.all(".flag-action-type-details strong").map(&:text) == choices
end
end
end
end