Commit 1048cdbd authored by Martin Wortschack's avatar Martin Wortschack Committed by Markus Koller

Notification icons: Render empty string for "custom" setting

parent 246852ee
...@@ -29,7 +29,10 @@ module NotificationsHelper ...@@ -29,7 +29,10 @@ module NotificationsHelper
end end
def notification_icon(level) def notification_icon(level)
sprite_icon("#{notification_icon_class(level)}") icon = notification_icon_class(level)
return '' unless icon
sprite_icon(icon)
end end
def notification_title(level) def notification_title(level)
......
---
title: 'Notifications icon: Render empty string for custom setting'
merge_request: 42848
author:
type: other
...@@ -10,6 +10,7 @@ RSpec.describe NotificationsHelper do ...@@ -10,6 +10,7 @@ RSpec.describe NotificationsHelper do
it { expect(notification_icon(:mention)).to match('data-testid="at-icon"') } it { expect(notification_icon(:mention)).to match('data-testid="at-icon"') }
it { expect(notification_icon(:global)).to match('data-testid="earth-icon') } it { expect(notification_icon(:global)).to match('data-testid="earth-icon') }
it { expect(notification_icon(:watch)).to match('data-testid="eye-icon"') } it { expect(notification_icon(:watch)).to match('data-testid="eye-icon"') }
it { expect(notification_icon(:custom)).to equal('') }
end end
describe 'notification_title' do describe 'notification_title' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment