diff --git a/app/assets/javascripts/discourse/app/components/reviewable-item.js b/app/assets/javascripts/discourse/app/components/reviewable-item.js index cf7ee8e5776..235e4953631 100644 --- a/app/assets/javascripts/discourse/app/components/reviewable-item.js +++ b/app/assets/javascripts/discourse/app/components/reviewable-item.js @@ -49,7 +49,7 @@ export default class ReviewableItem extends Component { @service siteSettings; @service currentUser; @service composer; - @optionalService adminTools; + @optionalService("admin-tools") adminTools; updating = null; editing = false; diff --git a/spec/fabricators/reviewable_fabricator.rb b/spec/fabricators/reviewable_fabricator.rb index 25d7c7eb5db..f3a11cc7673 100644 --- a/spec/fabricators/reviewable_fabricator.rb +++ b/spec/fabricators/reviewable_fabricator.rb @@ -96,6 +96,7 @@ Fabricator(:reviewable_flagged_post) do reviewable_by_moderator true type "ReviewableFlaggedPost" created_by { Fabricate(:user) } + target_created_by { Fabricate(:user) } topic target_type "Post" target { Fabricate(:post) } diff --git a/spec/system/reviewables_spec.rb b/spec/system/reviewables_spec.rb index 7ab0072ab34..203dcb74b99 100644 --- a/spec/system/reviewables_spec.rb +++ b/spec/system/reviewables_spec.rb @@ -54,6 +54,21 @@ describe "Reviewables", type: :system do expect(composer).to be_opened expect(composer.composer_input.value).to eq(post.raw) end + + it "should open a modal when suspending a user" do + visit("/review") + + select_kit = + PageObjects::Components::SelectKit.new(".dropdown-select-box.post-agree-and-hide") + select_kit.expand + + select_kit.select_row_by_value("post-agree_and_suspend") + + expect(review_page).to have_css( + "#discourse-modal-title", + text: I18n.t("js.flagging.take_action_options.suspend.title"), + ) + end end end