mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-25 18:28:31 +08:00
This adds some new icon aliases so the lock icon can be overridden in specific scenarios without applying globally to all locks: * "topic.closed" * "topic.opened" * "category.restricted" This enables customizations like:  ``` import { apiInitializer } from "discourse/lib/api"; export default apiInitializer((api) => { api.replaceIcon("topic.closed", "xmark"); api.replaceIcon("category.restricted", "shield-halved"); }); ``` More documentation on this feature in https://meta.discourse.org/t/change-icons-globally/87751
29 lines
837 B
Ruby
Vendored
29 lines
837 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Components
|
|
module Review
|
|
class TopicLink < PageObjects::Components::Base
|
|
WRAPPER_CSS = ".post-topic"
|
|
|
|
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
|