Commit f51694bd authored by Peter Leitzen's avatar Peter Leitzen

Merge branch '216017-test-tracking-of-render-better-on-view-for-buy-ci-minutes' into 'master'

Resolve "Test tracking of render better on view for buy ci minutes"

Closes #216017

See merge request gitlab-org/gitlab!30771
parents d3bd29ea af9fa160
......@@ -4,7 +4,6 @@ require 'spec_helper'
describe 'layouts/application' do
let_it_be(:user) { create(:user) }
let(:show_notification_dot) { false }
before do
allow(view).to receive(:experiment_enabled?).and_return(false)
......@@ -12,10 +11,16 @@ describe 'layouts/application' do
allow(view).to receive(:user_signed_in?).and_return(true)
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user))
allow(view).to receive(:show_ci_minutes_notification_dot?).and_return(show_notification_dot)
end
describe 'layouts/_user_notification_dot' do
let(:track_selector) { '[data-track-event="render"][data-track-label="show_buy_ci_minutes_notification"]' }
let(:show_notification_dot) { false }
before do
allow(view).to receive(:show_ci_minutes_notification_dot?).and_return(show_notification_dot)
end
context 'when we show the notification dot' do
let(:show_notification_dot) { true }
......@@ -27,7 +32,7 @@ describe 'layouts/application' do
render
expect(rendered).to have_css('span', class: 'header-user-notification-dot')
expect(rendered).to have_selector('[data-track-event="render"]')
expect(rendered).to have_selector(track_selector)
end
end
......@@ -36,7 +41,7 @@ describe 'layouts/application' do
render
expect(rendered).not_to have_css('span', class: 'header-user-notification-dot')
expect(rendered).not_to have_selector('[data-track-event="render"]')
expect(rendered).not_to have_selector(track_selector)
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