mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 10:36:19 +08:00
a5497b74be
This commit simplifies the initial state of the invite modal when it's opened to make it one click away from creating an invite link. The existing options/fields within the invite modal are still available, but are now hidden behind an advanced mode which can be enabled. On the technical front, this PR also switches the invite modal to use our FormKit library. Internal topic: t/134023.
61 lines
1021 B
Ruby
61 lines
1021 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Modals
|
|
class Base
|
|
include Capybara::DSL
|
|
include RSpec::Matchers
|
|
|
|
BODY_SELECTOR = ""
|
|
|
|
def header
|
|
find(".d-modal__header")
|
|
end
|
|
|
|
def body
|
|
find(".d-modal__body#{BODY_SELECTOR}")
|
|
end
|
|
|
|
def footer
|
|
find(".d-modal__footer")
|
|
end
|
|
|
|
def has_footer?
|
|
has_css?(".d-modal__footer")
|
|
end
|
|
|
|
def has_no_footer?
|
|
has_no_css?(".d-modal__footer")
|
|
end
|
|
|
|
def close
|
|
find(".modal-close").click
|
|
end
|
|
|
|
def cancel
|
|
find(".d-modal-cancel").click
|
|
end
|
|
|
|
def click_outside
|
|
find(".d-modal").click(x: 0, y: 0)
|
|
end
|
|
|
|
def click_primary_button
|
|
footer.find(".btn-primary").click
|
|
end
|
|
|
|
def has_content?(content)
|
|
body.has_content?(content)
|
|
end
|
|
|
|
def open?
|
|
has_css?(".modal.d-modal")
|
|
end
|
|
|
|
def closed?
|
|
has_no_css?(".modal.d-modal")
|
|
end
|
|
end
|
|
end
|
|
end
|