mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-23 23:04:48 +08:00
Some checks failed
Licenses / run (push) Has been cancelled
Linting / run (push) Has been cancelled
Migration Tests / Tests (push) Has been cancelled
Publish Assets / publish-assets (push) Has been cancelled
Tests / core backend (push) Has been cancelled
Tests / plugins backend (push) Has been cancelled
Tests / core frontend (Chrome) (push) Has been cancelled
Tests / plugins frontend (push) Has been cancelled
Tests / themes frontend (push) Has been cancelled
Tests / core system (push) Has been cancelled
Tests / plugins system (push) Has been cancelled
Tests / themes system (push) Has been cancelled
Tests / core frontend (Firefox ESR) (push) Has been cancelled
Tests / core frontend (Firefox Evergreen) (push) Has been cancelled
Tests / chat system (push) Has been cancelled
Tests / merge (push) Has been cancelled
This commit moves the /admin/config/theme-site-settings page to a tab in the "Themes and components" config page. This will make it easier to find for admins. Also add a `AdminFilterControls` component to the page to filter by setting name, description, or theme name.
47 lines
1.4 KiB
Ruby
Vendored
47 lines
1.4 KiB
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
describe "Admin Theme Site Settings", type: :system do
|
|
fab!(:current_user) { Fabricate(:admin) }
|
|
fab!(:theme_1) { Fabricate(:theme, name: "Blue Steel") }
|
|
fab!(:theme_2) { Fabricate(:theme, name: "Derelicte") }
|
|
fab!(:theme_site_setting_1) do
|
|
Fabricate(
|
|
:theme_site_setting_with_service,
|
|
theme: theme_1,
|
|
name: "enable_welcome_banner",
|
|
value: false,
|
|
)
|
|
end
|
|
fab!(:theme_site_setting_2) do
|
|
Fabricate(
|
|
:theme_site_setting_with_service,
|
|
theme: theme_2,
|
|
name: "search_experience",
|
|
value: "search_field",
|
|
)
|
|
end
|
|
|
|
let(:theme_site_settings_page) { PageObjects::Pages::AdminThemeSiteSettings.new }
|
|
|
|
before { sign_in(current_user) }
|
|
|
|
it "shows the themeable site settings and their name, description, and default value" do
|
|
visit "/admin/config/customize/theme-site-settings"
|
|
expect(theme_site_settings_page).to have_setting_with_default("enable_welcome_banner")
|
|
expect(theme_site_settings_page).to have_setting_with_default("search_experience")
|
|
end
|
|
|
|
it "shows links to each theme that overrides the default and overridden values" do
|
|
visit "/admin/config/customize/theme-site-settings"
|
|
expect(theme_site_settings_page).to have_theme_overriding(
|
|
"enable_welcome_banner",
|
|
theme_1,
|
|
"false",
|
|
)
|
|
expect(theme_site_settings_page).to have_theme_overriding(
|
|
"search_experience",
|
|
theme_2,
|
|
"search_field",
|
|
)
|
|
end
|
|
end
|