discourse/spec/system/page_objects/components/review/topic_link.rb
Alan Guo Xiang Tan 004228131b
UX: Improve layout for reviewable flagged post in new UI (#33534)
Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
2025-09-17 09:10:52 +08:00

29 lines
856 B
Ruby
Vendored

# frozen_string_literal: true
module PageObjects
module Components
module Review
class TopicLink < PageObjects::Components::Base
WRAPPER_CSS = ".review-item__meta-topic-title"
def has_closed_topic_status?
within(WRAPPER_CSS) { has_css?(".topic-status [class*='d-icon-topic.closed']") }
end
def has_topic_link?(topic_title:, post_url:)
within(WRAPPER_CSS) { expect(page).to have_link(topic_title, href: post_url) }
end
def has_category_badge?(category_name)
within(WRAPPER_CSS) do
expect(page).to have_css(".badge-category__name", text: category_name)
end
end
def has_tag_link?(tag_name:, tag_url:)
within(WRAPPER_CSS) { expect(page).to have_link(tag_name, href: tag_url) }
end
end
end
end
end