Commit e9755388 authored by Alper Akgun's avatar Alper Akgun

Merge branch '345854-group-namespace-billing-hand-raise-test-improvement' into 'master'

Group namespace billing hand raise test improvement

See merge request gitlab-org/gitlab!82078
parents 3f0faea1 b7b26416
...@@ -63,13 +63,22 @@ RSpec.describe 'Billing plan pages', :feature, :js do ...@@ -63,13 +63,22 @@ RSpec.describe 'Billing plan pages', :feature, :js do
end end
end end
shared_examples 'can not contact sales' do
before do
visit page_path
end
it 'does not render in-app hand raise lead' do
expect(page).to have_selector(".js-hand-raise-lead-button[data-namespace-id='#{namespace.id}'][data-user-name='#{user.username}']", visible: false)
end
end
shared_examples 'can contact sales' do shared_examples 'can contact sales' do
before do before do
visit page_path visit page_path
end end
it 'displays the in-app hand raise lead', :aggregate_failures do it 'displays the in-app hand raise lead', :aggregate_failures do
if namespace.group_namespace?
form_data = { form_data = {
first_name: user.first_name, first_name: user.first_name,
last_name: user.last_name, last_name: user.last_name,
...@@ -120,9 +129,6 @@ RSpec.describe 'Billing plan pages', :feature, :js do ...@@ -120,9 +129,6 @@ RSpec.describe 'Billing plan pages', :feature, :js do
click_button 'Submit information' click_button 'Submit information'
end end
else
expect(page).to have_selector(".js-hand-raise-lead-button[data-namespace-id='#{namespace.id}'][data-user-name='#{user.username}']", visible: false)
end
end end
end end
...@@ -293,7 +299,7 @@ RSpec.describe 'Billing plan pages', :feature, :js do ...@@ -293,7 +299,7 @@ RSpec.describe 'Billing plan pages', :feature, :js do
it_behaves_like 'plan with header' it_behaves_like 'plan with header'
it_behaves_like 'downgradable plan' it_behaves_like 'downgradable plan'
it_behaves_like 'upgradable plan' it_behaves_like 'upgradable plan'
it_behaves_like 'can contact sales' it_behaves_like 'can not contact sales'
it_behaves_like 'plan with subscription table' it_behaves_like 'plan with subscription table'
context 'when hide_deprecated_billing_plans is active' do context 'when hide_deprecated_billing_plans is active' do
...@@ -327,7 +333,7 @@ RSpec.describe 'Billing plan pages', :feature, :js do ...@@ -327,7 +333,7 @@ RSpec.describe 'Billing plan pages', :feature, :js do
it_behaves_like 'plan with header' it_behaves_like 'plan with header'
it_behaves_like 'downgradable plan' it_behaves_like 'downgradable plan'
it_behaves_like 'upgradable plan' it_behaves_like 'upgradable plan'
it_behaves_like 'can contact sales' it_behaves_like 'can not contact sales'
it_behaves_like 'plan with subscription table' it_behaves_like 'plan with subscription table'
it_behaves_like 'does not display EoA banner' it_behaves_like 'does not display EoA banner'
end end
...@@ -386,7 +392,7 @@ RSpec.describe 'Billing plan pages', :feature, :js do ...@@ -386,7 +392,7 @@ RSpec.describe 'Billing plan pages', :feature, :js do
it_behaves_like 'plan with header' it_behaves_like 'plan with header'
it_behaves_like 'downgradable plan' it_behaves_like 'downgradable plan'
it_behaves_like 'upgradable plan' it_behaves_like 'upgradable plan'
it_behaves_like 'can contact sales' it_behaves_like 'can not contact sales'
end end
context 'on ultimate plan' do context 'on ultimate plan' 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