mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add a checkbox for users to confirm before flagging as illegal (#25762)
The Digital Services Act requires a checkbox for any user who's flagging a post as illegal to confirm that they are flagging in good faith. This PR adds that.
This commit is contained in:
@@ -32,4 +32,22 @@ describe "Flagging post", type: :system do
|
||||
expect(page).to have_css(".reviewable-meta-data .status .approved")
|
||||
end
|
||||
end
|
||||
|
||||
describe "As Illegal" do
|
||||
it do
|
||||
topic_page.visit_topic(post_to_flag.topic)
|
||||
topic_page.expand_post_actions(post_to_flag)
|
||||
topic_page.click_post_action_button(post_to_flag, :flag)
|
||||
flag_modal.choose_type(:illegal)
|
||||
|
||||
expect(flag_modal).to have_css(".flag-confirmation")
|
||||
|
||||
flag_modal.fill_message("This looks totally illegal to me.")
|
||||
flag_modal.check_confirmation
|
||||
|
||||
flag_modal.confirm_flag
|
||||
|
||||
expect(page).to have_content(I18n.t("js.post.actions.by_you.illegal"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,6 +20,14 @@ module PageObjects
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user