mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: "Hot" replacing "Top" as default in the top menu (#28252)
This change only applies to instances that have not modified the `top_menu` site setting.
This commit is contained in:
@@ -31,4 +31,34 @@ describe "User preferences | Interface", type: :system do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "Default Home Page" do
|
||||
context "when a user has picked a home page that is no longer available in top_menu" do
|
||||
it "shows the selected homepage" do
|
||||
SiteSetting.top_menu = "latest|hot"
|
||||
|
||||
user.user_option.update!(homepage_id: UserOption::HOMEPAGES.key("unread"))
|
||||
user_preferences_page.visit(user)
|
||||
click_link(I18n.t("js.user.preferences_nav.interface"))
|
||||
|
||||
dropdown = PageObjects::Components::SelectKit.new("#home-selector")
|
||||
|
||||
expect(dropdown).to have_selected_name("Unread")
|
||||
end
|
||||
end
|
||||
|
||||
it "shows only the available home pages from top_menu" do
|
||||
SiteSetting.top_menu = "latest|hot"
|
||||
|
||||
user_preferences_page.visit(user)
|
||||
click_link(I18n.t("js.user.preferences_nav.interface"))
|
||||
|
||||
dropdown = PageObjects::Components::SelectKit.new("#home-selector")
|
||||
dropdown.expand
|
||||
expect(dropdown).to have_option_value(UserOption::HOMEPAGES.key("latest"))
|
||||
expect(dropdown).to have_option_value(UserOption::HOMEPAGES.key("hot"))
|
||||
expect(dropdown).to have_no_option_value(UserOption::HOMEPAGES.key("top"))
|
||||
expect(dropdown).to have_no_option_value(UserOption::HOMEPAGES.key("new"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user