Commit b7b26416 authored by Alper Akgun's avatar Alper Akgun

Group namespace billing hand raise test improvement

parent 394460bd
......@@ -63,13 +63,22 @@ RSpec.describe 'Billing plan pages', :feature, :js do
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
before do
visit page_path
end
it 'displays the in-app hand raise lead', :aggregate_failures do
if namespace.group_namespace?
form_data = {
first_name: user.first_name,
last_name: user.last_name,
......@@ -120,9 +129,6 @@ RSpec.describe 'Billing plan pages', :feature, :js do
click_button 'Submit information'
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
......@@ -293,7 +299,7 @@ RSpec.describe 'Billing plan pages', :feature, :js do
it_behaves_like 'plan with header'
it_behaves_like 'downgradable 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'
context 'when hide_deprecated_billing_plans is active' do
......@@ -327,7 +333,7 @@ RSpec.describe 'Billing plan pages', :feature, :js do
it_behaves_like 'plan with header'
it_behaves_like 'downgradable 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 'does not display EoA banner'
end
......@@ -386,7 +392,7 @@ RSpec.describe 'Billing plan pages', :feature, :js do
it_behaves_like 'plan with header'
it_behaves_like 'downgradable plan'
it_behaves_like 'upgradable plan'
it_behaves_like 'can contact sales'
it_behaves_like 'can not contact sales'
end
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