mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 13:08:40 +08:00
This is a small PR just enabling the refreshed review page for everyone. At this stage, I don't want to remove the site setting so we can potentially quickly revert that change. I will create a follow-up PR that will remove the hidden site setting and all legacy code. Some tests were irrelevant. For example, in the old layout, long posts were collapsed. In the new layout, we have an inline scroll. <img width="1143" height="679" alt="Screenshot 2025-12-16 at 12 37 37 pm" src="https://github.com/user-attachments/assets/3020dfd1-f84b-44ca-906f-385536bdce3d" />
43 lines
1.1 KiB
Ruby
Vendored
43 lines
1.1 KiB
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
describe "Reviewables", type: :system do
|
|
fab!(:current_user, :admin)
|
|
fab!(:channel_1, :chat_channel)
|
|
fab!(:message_1) { Fabricate(:chat_message, chat_channel: channel_1) }
|
|
|
|
before do
|
|
chat_system_bootstrap(current_user)
|
|
channel_1.add(current_user)
|
|
sign_in(current_user)
|
|
|
|
Chat::ReviewQueue.new.flag_message(
|
|
message_1,
|
|
current_user.guardian,
|
|
ReviewableScore.types[:spam],
|
|
)
|
|
end
|
|
|
|
context "when visiting reviews for messages " do
|
|
it "lists the correct message" do
|
|
visit("/review?type=Chat%3A%3AReviewableMessage")
|
|
|
|
expect(page).to have_content(message_1.message)
|
|
end
|
|
end
|
|
|
|
context "when the message is hard deleted" do
|
|
before { message_1.destroy! }
|
|
|
|
it "does not throw an error" do
|
|
visit("/review?type=Chat%3A%3AReviewableMessage")
|
|
|
|
expect(page).to have_selector(".review-item__post-content")
|
|
end
|
|
|
|
it "adds the option to ignore the flag" do
|
|
visit("/review?type=Chat%3A%3AReviewableMessage")
|
|
|
|
expect(page).to have_text(I18n.t("chat.reviewables.actions.ignore.title"))
|
|
end
|
|
end
|
|
end
|