discourse/spec/system/page_objects/components/empty_state.rb
Martin Brennan 66179c60cd
FEATURE: Always show All, Topics, and Replies subtabs for unified new (#35292)
Currently, if a user is part of a group in
`experimental_new_new_view_groups`,
they will see tabs for All, Topics, and Replies underneath the New tab
in the
/new  topic list.

However, if one of the tabs has no topics (i.e. no more unread replies
or no more new topics), we hide the tabs entirely. This can be confusing
and inconsistent for members.

This commit changes the behavior so that the tabs are always shown.
Also, we change the text and route of the empty topic list CTA based on
the subtab
the user is on:

* Topics subtab, when there are new Replies:
  * Button text: Browse new replies
  * Button points to the Replies subtab
* Replies subtab, when there are new Topics:
  * Button text: Browse new topics
  * Button points to Topics subtab
* All subtab, or any subtab when there are no new topics of any kind:
  * Button text: Browse latest topics
  * Button points to /latest
2025-10-15 09:47:23 +10:00

15 lines
302 B
Ruby

# frozen_string_literal: true
module PageObjects
module Components
class EmptyState < PageObjects::Components::Base
def has_cta_text?(text)
has_css?(".empty-state__cta", text: text)
end
def click_cta
find(".empty-state__cta").click
end
end
end
end