Commit e5b5a130 authored by Alper Akgun's avatar Alper Akgun

Add js billing plans box to profiles

We currently show the subscription box on group billing pages. This MR
shows them also on personal billing pages
parent 28ac36c6
import initSubscriptions from 'ee/billings';
import PersistentUserCallout from '~/persistent_user_callout'; import PersistentUserCallout from '~/persistent_user_callout';
document.addEventListener('DOMContentLoaded', () => document.addEventListener('DOMContentLoaded', () => {
PersistentUserCallout.factory(document.querySelector('.js-gold-trial-callout')), PersistentUserCallout.factory(document.querySelector('.js-gold-trial-callout'));
);
initSubscriptions();
});
- page_title 'Billing' - page_title 'Billing'
- current_plan = subscription_plan_info(@plans_data, current_user.namespace.actual_plan_name)
= render 'shared/billings/billing_plans', plans_data: @plans_data, namespace: current_user.namespace = render 'shared/billings/billing_plans', plans_data: @plans_data, namespace: current_user.namespace
#js-billing-plans{ data: subscription_plan_data_attributes(current_user.namespace, current_plan) }
---
title: Add billing plans box to profiles
merge_request: 22270
author:
type: fixed
...@@ -82,6 +82,16 @@ describe 'Billing plan pages', :feature do ...@@ -82,6 +82,16 @@ describe 'Billing plan pages', :feature do
end end
end end
shared_examples 'plan with subscription table' do
before do
visit page_path
end
it 'displays subscription table', :js do
expect(page).to have_selector('.js-subscription-table')
end
end
context 'users profile billing page' do context 'users profile billing page' do
let(:page_path) { profile_billings_path } let(:page_path) { profile_billings_path }
...@@ -129,6 +139,8 @@ describe 'Billing plan pages', :feature do ...@@ -129,6 +139,8 @@ describe 'Billing plan pages', :feature do
end end
end end
end end
it_behaves_like 'plan with subscription table'
end end
context 'on bronze plan' do context 'on bronze plan' do
...@@ -141,6 +153,7 @@ describe 'Billing plan pages', :feature do ...@@ -141,6 +153,7 @@ describe 'Billing plan pages', :feature 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 'plan with subscription table'
end end
context 'on silver plan' do context 'on silver plan' do
...@@ -153,6 +166,7 @@ describe 'Billing plan pages', :feature do ...@@ -153,6 +166,7 @@ describe 'Billing plan pages', :feature 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 'plan with subscription table'
end end
context 'on gold plan' do context 'on gold plan' do
...@@ -165,6 +179,7 @@ describe 'Billing plan pages', :feature do ...@@ -165,6 +179,7 @@ describe 'Billing plan pages', :feature 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 'non-upgradable plan' it_behaves_like 'non-upgradable plan'
it_behaves_like 'plan with subscription table'
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