discourse/spec/system/page_objects/modals/install_theme.rb
Alan Guo Xiang Tan dab361ac41
UX: Creating a new theme/component should redirect to theme edit route (#34353)
Prior to this change, creating a new theme or theme component was
causing the user to stay on the index route.
2025-08-19 11:30:44 +08:00

29 lines
778 B
Ruby

# frozen_string_literal: true
module PageObjects
module Modals
class InstallTheme < PageObjects::Modals::Base
MODAL_CLASS = ".admin-install-theme-modal"
def modal
find(MODAL_CLASS)
end
def popular_options
all(".popular-theme-item")
end
def create_new_theme(name:, component: false)
within(MODAL_CLASS) do
find(".install-theme-item__create").click
find(".install-theme-content__theme-name").fill_in(with: name)
type_dropdown = PageObjects::Components::SelectKit.new(".single-select")
expect(type_dropdown.value).to eq(component ? "components" : "themes")
click_button(I18n.t("admin_js.admin.customize.theme.create"))
end
end
end
end
end