Martin Brennan 0a4b1b655d
FIX: Alter "Take Action" default behaviour to hide post (#24088)
This commit fixes an issue where clicking the default
"Take Action" option on a flag for a post doesn't always
end up with the post hidden.

This is because the "take_action" score bonus doesn’t take into account
the final score required to hide the post.

Especially with the `hide_post_sensitivity` site setting set to `low`
sensitivity, there is a likelihood the score needed to hide the post
won’t be reached.

Now, the default "Take Action" button has been changed to "Hide Post"
to reflect what is actually happening and the description has been
improved, and if "Take Action" is clicked we _always_ hide the post
regardless of score and sensitivity settings. This way the action reflects
expectations of the user.
2023-10-30 10:24:35 +10:00

49 lines
822 B
Ruby

# frozen_string_literal: true
module PageObjects
module Modals
class Base
include Capybara::DSL
include RSpec::Matchers
BODY_SELECTOR = ""
def body
find(".modal-body#{BODY_SELECTOR}")
end
def footer
find(".modal-footer")
end
def close
find(".modal-close").click
end
def cancel
find(".d-modal-cancel").click
end
def click_outside
find(".modal-outer-container").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