discourse/spec/system/page_objects/components/d_page_header.rb
Osama Sayegh 7fce724089
FEATURE: Theme-owned color palettes (#32795)
This commit removes the color palette dropdown from the theme page and replaces it with a new "Colors" tab where the theme's color palette can be edited directly in that tab on the theme page. With this change, a theme's color palette is strongly tied to its theme and can't be linked to other themes and it can't be selected by users without using the theme as well.

All of the changes are behind a feature flag. To enable it, turn on the `use_overhauled_theme_color_palette` setting.

Co-authored-by: Ella <ella.estigoy@gmail.com>
2025-06-04 07:47:58 +03:00

49 lines
1 KiB
Ruby

# frozen_string_literal: true
module PageObjects
module Components
class DPageHeader < PageObjects::Pages::Base
def has_tabs?(names)
expect(page.all("#{tabs_container_selector} a").map(&:text)).to eq(names)
end
def has_tab?(tab_name)
has_css?(tab_selector(tab_name))
end
def has_no_tab?(tab_name)
has_no_css?(tab_selector(tab_name))
end
def has_active_tab?(tab_name)
has_css?("#{tab_selector(tab_name)} .active")
end
def tab(tab_name)
find(tab_selector(tab_name))
end
def visible?
has_css?(".d-page-header")
end
def hidden?
has_no_css?(".d-page-header")
end
private
def tabs_container_selector
"ul.d-nav-submenu__tabs"
end
def tab_item_selector(tab_name)
"li[class$='-tabs__#{tab_name}']"
end
def tab_selector(tab_name)
"#{tabs_container_selector} > #{tab_item_selector(tab_name)}"
end
end
end
end