Commit 9bae04ea authored by Nicolas Dular's avatar Nicolas Dular

Use snowplow helper for track panel type specs

parent 92d64d19
...@@ -8,20 +8,19 @@ RSpec.describe Gitlab::Metrics::Dashboard::Stages::TrackPanelType do ...@@ -8,20 +8,19 @@ RSpec.describe Gitlab::Metrics::Dashboard::Stages::TrackPanelType do
let(:project) { build_stubbed(:project) } let(:project) { build_stubbed(:project) }
let(:environment) { build_stubbed(:environment, project: project) } let(:environment) { build_stubbed(:environment, project: project) }
describe '#transform!' do describe '#transform!', :snowplow do
subject { described_class.new(project, dashboard, environment: environment) } subject { described_class.new(project, dashboard, environment: environment) }
let(:dashboard) { load_sample_dashboard.deep_symbolize_keys } let(:dashboard) { load_sample_dashboard.deep_symbolize_keys }
it 'creates tracking event' do it 'creates tracking event' do
stub_application_setting(snowplow_enabled: true, snowplow_collector_hostname: 'localhost')
allow(Gitlab::Tracking).to receive(:event).and_call_original
subject.transform! subject.transform!
expect(Gitlab::Tracking).to have_received(:event) expect_snowplow_event(
.with('MetricsDashboard::Chart', 'chart_rendered', { label: 'area-chart' }) category: 'MetricsDashboard::Chart',
.at_least(:once) action: 'chart_rendered',
label: 'area-chart'
)
end end
end 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