Commit 27be56f2 authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch 'fix-vsa-error-with-scoped-label-stages' into 'master'

Fix VSA error with scoped labels

See merge request gitlab-org/gitlab!82083
parents dcfdc833 56529414
......@@ -57,7 +57,7 @@ module Analytics
def html_description(event)
options = {}
if event.label_based?
label = event.label.present
label = event.label.present(issuable_subject: event.label.subject)
options[:label_html] = render_label(label, link: '', small: true, tooltip: true)
end
......
......@@ -6,11 +6,12 @@ RSpec.describe Analytics::CycleAnalytics::StageEntity do
subject(:entity_json) { described_class.new(Analytics::CycleAnalytics::StagePresenter.new(stage)).as_json }
context 'when label based event is given' do
let(:label) { create(:group_label, title: 'test label') }
let(:label) { create(:group_label, title: 'test::label') }
let(:stage) { build(:cycle_analytics_group_stage, group: label.group, start_event_label: label, start_event_identifier: :merge_request_label_added, end_event_identifier: :merge_request_merged) }
it 'includes the label reference in the description' do
expect(entity_json[:start_event_html_description]).to include(label.title)
expect(entity_json[:start_event_html_description]).to include('test')
expect(entity_json[:start_event_html_description]).to include('label')
end
end
end
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