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:
Ted Johansson
2024-02-21 10:49:19 +08:00
committed by GitHub
parent 0529d20db4
commit 533b91dec6
9 changed files with 50 additions and 1 deletions

View File

@@ -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

View File

@@ -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