Update theme_color_tags helper for new theme infrastructure (#37519)
This commit is contained in:
1 parent
be00db4fa3
commit
e58084a85f
3 files changed
+17
-18
No files matched your search
@@ -49,12 +49,12 @@ RSpec.describe ThemeHelper do
|
||||
end
|
||||
|
||||
describe 'theme_color_tags' do
|
||||
let(:result) { helper.theme_color_tags(theme) }
|
||||
let(:result) { helper.theme_color_tags(color_scheme) }
|
||||
|
||||
context 'when using system theme' do
|
||||
let(:theme) { 'system' }
|
||||
let(:color_scheme) { 'auto' }
|
||||
|
||||
it 'returns the mastodon-light and default stylesheets with correct color schemes' do
|
||||
it 'returns both color schemes with appropriate media queries' do
|
||||
expect(html_theme_colors.first.attributes.symbolize_keys)
|
||||
.to include(
|
||||
content: have_attributes(value: Themes::THEME_COLORS[:dark]),
|
||||
@@ -68,10 +68,10 @@ RSpec.describe ThemeHelper do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when using mastodon-light theme' do
|
||||
let(:theme) { 'mastodon-light' }
|
||||
context 'when light color scheme' do
|
||||
let(:color_scheme) { 'light' }
|
||||
|
||||
it 'returns the theme stylesheet without color scheme information' do
|
||||
it 'returns the light color' do
|
||||
expect(html_theme_colors.first.attributes.symbolize_keys)
|
||||
.to include(
|
||||
content: have_attributes(value: Themes::THEME_COLORS[:light])
|
||||
@@ -79,10 +79,10 @@ RSpec.describe ThemeHelper do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when using other theme' do
|
||||
let(:theme) { 'contrast' }
|
||||
context 'when using dark color scheme' do
|
||||
let(:color_scheme) { 'dark' }
|
||||
|
||||
it 'returns the theme stylesheet without color scheme information' do
|
||||
it 'returns the dark color' do
|
||||
expect(html_theme_colors.first.attributes.symbolize_keys)
|
||||
.to include(
|
||||
content: have_attributes(value: Themes::THEME_COLORS[:dark])
|
||||
|
||||
Reference in new issue
Block a user