mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Simplify theme and color scheme seeding (#10872)
Now that we have support for user-selectable color schemes, it makes sense to simplify seeding and theme updates in the wizard. We now: - seed only one theme, named "Default" (previously "Light") - seed a user-selectable Dark color scheme - rename the "Themes" wizard step to "Colors" - update the default theme's color scheme if a default is set (a new theme is created if there is no default)
This commit is contained in:
@@ -204,6 +204,13 @@ describe Wizard::StepUpdater do
|
||||
wizard.create_updater('colors', {}).update
|
||||
end.to_not change { SiteSetting.default_theme_id }
|
||||
end
|
||||
|
||||
it "should update the color scheme of the default theme" do
|
||||
updater = wizard.create_updater('colors', theme_previews: 'Neutral')
|
||||
expect { updater.update }.not_to change { Theme.count }
|
||||
theme.reload
|
||||
expect(theme.color_scheme.base_scheme_id).to eq('Neutral')
|
||||
end
|
||||
end
|
||||
|
||||
context "without an existing theme" do
|
||||
@@ -257,8 +264,6 @@ describe Wizard::StepUpdater do
|
||||
|
||||
theme = Theme.find_by(id: SiteSetting.default_theme_id)
|
||||
expect(theme.color_scheme_id).to eq(color_scheme.id)
|
||||
|
||||
expect(Theme.where(user_selectable: true).count).to eq(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user