mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 11:11:13 +08:00
DEV: Implement glimmer topic-list (#26743)
(experimental) The initial implementation of glimmer topic-list and related components. Does not include new APIs and isn't compatible with existing customization. That's gonna come in future PRs. Enabled by adding groups to `experimental_glimmer_topic_list_groups` setting.
This commit is contained in:
@ -3,6 +3,8 @@
|
||||
module PageObjects
|
||||
module Components
|
||||
class CategoryList < PageObjects::Components::Base
|
||||
TOPIC_LIST_ITEM_SELECTOR = ".category-list.with-topics .featured-topic"
|
||||
|
||||
def has_category?(category)
|
||||
page.has_css?("tr[data-category-id='#{category.id}']")
|
||||
end
|
||||
@ -30,6 +32,10 @@ module PageObjects
|
||||
def click_topic(topic)
|
||||
page.find("a", text: topic.title).click
|
||||
end
|
||||
|
||||
def topic_list_item_class(topic)
|
||||
"#{TOPIC_LIST_ITEM_SELECTOR}[data-topic-id='#{topic.id}']"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user