Commit 5fd19ee1 authored by Alper Akgun's avatar Alper Akgun Committed by Jacques Erasmus

Hand raise lead modal placeholder

parent 9be3299a
...@@ -66,6 +66,9 @@ ...@@ -66,6 +66,9 @@
- show_upgrade_button = show_upgrade_button?(purchase_link.action, plan_offer_type) - show_upgrade_button = show_upgrade_button?(purchase_link.action, plan_offer_type)
.gl-min-h-7.gl-display-flex.gl-flex-wrap.gl-justify-content-end .gl-min-h-7.gl-display-flex.gl-flex-wrap.gl-justify-content-end
- if show_contact_sales_button?(purchase_link.action, plan_offer_type) - if show_contact_sales_button?(purchase_link.action, plan_offer_type)
= link_to s_('BillingPlan|Contact sales'), "#{contact_sales_url}?test=inappcontactsales#{plan.code}", class: ["btn gl-button", show_upgrade_button ? "btn-success-secondary" : "btn-success"], data: { 'track-action': 'click_button', 'track-label': 'contact_sales', 'track-property': plan.code } - if Feature.enabled?(:in_app_hand_raise_pql, namespace)
.js-hand-raise-lead-button{ data: { namespace_id: namespace.id, user_name: current_user.username } }
- else
= link_to s_('BillingPlan|Contact sales'), "#{contact_sales_url}?test=inappcontactsales#{plan.code}", class: ["btn gl-button", show_upgrade_button ? "btn-success-secondary" : "btn-success"], data: { 'track-action': 'click_button', 'track-label': 'contact_sales', 'track-property': plan.code }
- if show_upgrade_button - if show_upgrade_button
= link_to upgrade_button_text(plan_offer_type), plan_purchase_or_upgrade_url(namespace, plan), class: ["btn btn-success gl-button", upgrade_button_css_classes(namespace, plan, is_current), "gl-ml-3"], data: { 'track-action': 'click_button', 'track-label': 'upgrade', 'track-property': plan.code, qa_selector: "upgrade_to_#{plan.code}" } = link_to upgrade_button_text(plan_offer_type), plan_purchase_or_upgrade_url(namespace, plan), class: ["btn btn-success gl-button", upgrade_button_css_classes(namespace, plan, is_current), "gl-ml-3"], data: { 'track-action': 'click_button', 'track-label': 'upgrade', 'track-property': plan.code, qa_selector: "upgrade_to_#{plan.code}" }
...@@ -64,15 +64,31 @@ RSpec.describe 'Billing plan pages', :feature, :js do ...@@ -64,15 +64,31 @@ RSpec.describe 'Billing plan pages', :feature, :js do
end end
shared_examples 'can contact sales' do shared_examples 'can contact sales' do
before do context 'with in app hand raise feature flag off' do
visit page_path before do
stub_feature_flags(in_app_hand_raise_pql: false)
visit page_path
end
it 'displays the contact sales link' do
# see ApplicationHelper#contact_sales_url
contact_sales_url = "https://#{ApplicationHelper.promo_host}/sales"
page.within('.content') do
expect(page).to have_link('Contact sales', href: %r{#{contact_sales_url}\?test=inappcontactsales(bronze|premium|gold)})
end
end
end end
it 'displays the contact sales link' do context 'with in app hand raise feature flag on' do
# see ApplicationHelper#contact_sales_url before do
contact_sales_url = "https://#{ApplicationHelper.promo_host}/sales" stub_feature_flags(in_app_hand_raise_pql: namespace)
page.within('.content') do visit page_path
expect(page).to have_link('Contact sales', href: %r{#{contact_sales_url}\?test=inappcontactsales(bronze|premium|gold)}) end
it 'displays the in-app hand raise lead' do
page.within('.content') 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 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