UX: Add custom section button should not be shown to anon users (#21651)

This commit is contained in:
Alan Guo Xiang Tan
2023-05-19 10:31:25 +09:00
committed by GitHub
parent 96e3c5e102
commit b183b997fb
3 changed files with 27 additions and 13 deletions

View File

@ -15,8 +15,12 @@ module PageObjects
page.has_link?(category.name, class: "sidebar-section-link")
end
def open_new_custom_section
find("button.add-section").click
def click_add_section_button
click_button(add_section_button_text)
end
def has_no_add_section_button?
page.has_no_button?(add_section_button_text)
end
def edit_custom_section(name)
@ -68,6 +72,10 @@ module PageObjects
attributes[:class] += "--active" if active
page.public_send(present ? :has_link? : :has_no_link?, name, **attributes)
end
def add_section_button_text
I18n.t("js.sidebar.sections.custom.add")
end
end
end
end