mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: Default to light theme in wizard so that previews are displayed
Previously, without a theme selection, the previews wouldn't show.
This commit is contained in:
@ -155,7 +155,7 @@ class Wizard
|
|||||||
id: 'theme_previews',
|
id: 'theme_previews',
|
||||||
type: 'component',
|
type: 'component',
|
||||||
required: !default_theme_override,
|
required: !default_theme_override,
|
||||||
value: scheme_id
|
value: scheme_id || ColorScheme::LIGHT_THEME_ID
|
||||||
)
|
)
|
||||||
|
|
||||||
# fix for the case when base_scheme is nil
|
# fix for the case when base_scheme is nil
|
||||||
|
@ -176,14 +176,26 @@ describe Wizard::Builder do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "when the default theme has been override" do
|
describe "when the default theme has been overridden by a theme without a color scheme" do
|
||||||
before do
|
before do
|
||||||
theme.set_default!
|
theme.set_default!
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should set the right default values' do
|
it 'should set the right default values' do
|
||||||
expect(field.required).to eq(false)
|
expect(field.required).to eq(false)
|
||||||
expect(field.value).to eq(nil)
|
expect(field.value).to eq("Light")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "when the default theme has been overridden by a theme with a color scheme" do
|
||||||
|
before do
|
||||||
|
theme.update(color_scheme_id: ColorScheme.find_by_name("Dark").id)
|
||||||
|
theme.set_default!
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should set the right default values' do
|
||||||
|
expect(field.required).to eq(false)
|
||||||
|
expect(field.value).to eq("Dark")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user