2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-03-04 01:15:08 +08:00
discourse/spec/system/post_small_action_spec.rb
Joffrey JAFFEUX c70e18faa0
DEV: updates playwright to 1.54 (#33715)
Relevant info:

bb2dcadfd3

https://playwright.dev/docs/release-notes#version-153

https://playwright.dev/docs/release-notes#version-154

Note this commit introduces `wait_for_timeout` which should only be used in very rare and specific case. Aa much as possible developers have to find a way to provide a change in the DOM to hook their assertions to it.
2025-07-24 10:07:31 +02:00

51 lines
1.5 KiB
Ruby

# frozen_string_literal: true
describe "Post small actions", type: :system do
fab!(:admin)
fab!(:topic)
fab!(:first_post) do
Fabricate(:post, topic: topic, raw: "This is a special post with special stuff")
end
let(:topic_page) { PageObjects::Pages::Topic.new }
let(:composer) { PageObjects::Components::Composer.new }
before do
sign_in(admin)
Jobs.run_immediately!
end
it "applies search highlight decorations" do
post = Fabricate(:small_action, raw: "This small post is also special", topic: topic)
topic_page.visit_topic(topic)
expect(topic_page).to have_post_number(post.post_number)
find(".search-dropdown").click
find("#icon-search-input").fill_in(with: "special")
find(".search-menu-assistant-item:nth-child(2)").click
# has highlighting for the regular post
expect(page).to have_css(".topic-post.regular .highlighted")
# has highlighting for the small action post
expect(page).to have_css(".small-action .highlighted")
end
it "applies animated gif decorations" do
post =
Fabricate(:small_action, raw: "Enjoy this gif", topic: topic, action_code: "closed.enabled")
topic_page.visit_topic(topic)
expect(topic_page).to have_post_number(post.post_number)
find(".small-action-buttons .small-action-edit").click
attach_file("file-uploader", file_from_fixtures("animated.gif").path, make_visible: true)
expect(composer).to have_no_in_progress_uploads
composer.submit
expect(page).to have_css(".small-action .pausable-animated-image", wait: 5)
end
end