2023-03-09 09:53:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-06-06 21:26:58 -04:00
|
|
|
describe "Composer using review_media", type: :system do
|
2023-03-09 09:53:27 -05:00
|
|
|
fab!(:user) { Fabricate(:user) }
|
|
|
|
fab!(:topic) { Fabricate(:topic, category: Category.find(SiteSetting.uncategorized_category_id)) }
|
|
|
|
fab!(:post) { Fabricate(:post, topic: topic) }
|
|
|
|
let(:topic_page) { PageObjects::Pages::Topic.new }
|
|
|
|
|
|
|
|
before do
|
|
|
|
SiteSetting.review_media_unless_trust_level = 3
|
|
|
|
sign_in user
|
|
|
|
end
|
|
|
|
|
|
|
|
it "does not flag a post with an emoji" do
|
|
|
|
topic_page.visit_topic_and_open_composer(topic)
|
|
|
|
topic_page.fill_in_composer(" this one has an emoji: :mask: ")
|
|
|
|
|
|
|
|
within(".d-editor-preview") { expect(page).to have_css(".emoji") }
|
|
|
|
topic_page.send_reply
|
|
|
|
|
|
|
|
expect(topic_page).to have_post_number(2)
|
|
|
|
expect(page).not_to have_css(".post-enqueued-modal")
|
|
|
|
end
|
|
|
|
|
2023-03-26 20:22:37 -04:00
|
|
|
it "flags a post with an image" do
|
|
|
|
topic_page.visit_topic_and_open_composer(topic)
|
|
|
|
topic_page.fill_in_composer(" this one has an upload: ")
|
2023-03-09 09:53:27 -05:00
|
|
|
|
2023-03-26 20:22:37 -04:00
|
|
|
attach_file "file-uploader", "#{Rails.root}/spec/fixtures/images/logo.jpg", make_visible: true
|
|
|
|
within(".d-editor-preview") { expect(page).to have_css("img") }
|
|
|
|
topic_page.send_reply
|
2023-03-09 09:53:27 -05:00
|
|
|
|
2023-03-26 20:22:37 -04:00
|
|
|
expect(page).to have_css(".post-enqueued-modal")
|
|
|
|
end
|
2023-03-09 09:53:27 -05:00
|
|
|
end
|