discourse/spec/system/page_objects/admin_emojis.rb
Martin Brennan 5711bf6f27
DEV: Move admin config pages out of /customize/ sub-route (#30511)
The customize routes add CSS classes that make these admin
config pages look different from the ones under /admin/config.
We want all config routes to be under /admin/config as well.

This commit moves the emoji, user fields, and permalinks pages
out of customize and into config, updating all references and
adding more rails routes as needed.

Also renames admin emojis route to emoji, emoji is singular and plural.
2025-01-02 09:13:11 +10:00

44 lines
936 B
Ruby

# frozen_string_literal: true
module PageObjects
module Pages
class AdminEmojis < PageObjects::Pages::Base
def visit_page
page.visit "/admin/config/emoji"
self
end
def click_tab(tab_name)
case tab_name
when "settings"
find(".admin-emoji-tabs__settings").click
when "index"
find(".admin-emoji-tabs__emoji").click
end
end
def has_emoji_listed?(name)
page.has_css?(emoji_table_selector, text: name)
end
def has_no_emoji_listed?(name)
page.has_no_css?(emoji_table_selector, text: name)
end
def delete_emoji(name)
find(".d-admin-row__content", text: name).find(delete_button_selector).click
end
private
def emoji_table_selector
"#custom_emoji"
end
def delete_button_selector
".d-admin-row__controls-delete"
end
end
end
end